Re: [PATCH 2/4] clk: qcom: common: introduce qcom_cc_sync_state()

From: Dmitry Baryshkov

Date: Sat Jun 06 2026 - 07:18:25 EST


On Wed, Jun 03, 2026 at 10:21:47AM -0400, Brian Masney wrote:
> Several qcom clk providers currently have a sync_state helper set to
> icc_sync_state(). With an upcoming change to the clk framework, if
> sync_state is not defined for the device, then the clk framework sets it
> to clk_sync_state().
>
> Clk providers that require their own sync_state will need to call the
> framework level clk_sync_state(). Let's introduce a new common helper
> qcom_cc_sync_state() that calls icc_sync_state() and clk_sync_state().
>
> Signed-off-by: Brian Masney <bmasney@xxxxxxxxxx>
> ---
> drivers/clk/qcom/common.c | 9 +++++++++
> drivers/clk/qcom/common.h | 1 +
> 2 files changed, 10 insertions(+)
>
> diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c
> index eec369d2173b..31382c49c948 100644
> --- a/drivers/clk/qcom/common.c
> +++ b/drivers/clk/qcom/common.c
> @@ -3,12 +3,14 @@
> * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
> */
>
> +#include <linux/clk.h>
> #include <linux/export.h>
> #include <linux/module.h>
> #include <linux/regmap.h>
> #include <linux/platform_device.h>
> #include <linux/clk-provider.h>
> #include <linux/interconnect-clk.h>
> +#include <linux/interconnect-provider.h>
> #include <linux/pm_runtime.h>
> #include <linux/reset-controller.h>
> #include <linux/of.h>
> @@ -464,5 +466,12 @@ int qcom_cc_probe_by_index(struct platform_device *pdev, int index,
> }
> EXPORT_SYMBOL_GPL(qcom_cc_probe_by_index);
>
> +void qcom_cc_sync_state(struct device *dev)
> +{
> + icc_sync_state(dev);

Only if desc->icc_hws != 0, otherwise it will mess the interconnect
internals. You might need to set drvdata to desc.

> + clk_sync_state(dev);
> +}
> +EXPORT_SYMBOL_GPL(qcom_cc_sync_state);
> +
> MODULE_LICENSE("GPL v2");
> MODULE_DESCRIPTION("QTI Common Clock module");
> diff --git a/drivers/clk/qcom/common.h b/drivers/clk/qcom/common.h
> index 6f2406f8839e..ee448163b1fc 100644
> --- a/drivers/clk/qcom/common.h
> +++ b/drivers/clk/qcom/common.h
> @@ -88,5 +88,6 @@ extern int qcom_cc_probe(struct platform_device *pdev,
> const struct qcom_cc_desc *desc);
> extern int qcom_cc_probe_by_index(struct platform_device *pdev, int index,
> const struct qcom_cc_desc *desc);
> +extern void qcom_cc_sync_state(struct device *dev);
>
> #endif
>
> --
> 2.54.0
>

--
With best wishes
Dmitry