From: Brian Masney <bmasney@redhat.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: Saravana Kannan <saravanak@kernel.org>,
Abel Vesa <abelvesa@kernel.org>,
Maxime Ripard <mripard@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Russell King <linux@armlinux.org.uk>,
Bjorn Andersson <andersson@kernel.org>,
Hans de Goede <johannes.goede@oss.qualcomm.com>,
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org,
Jens Glathe <jens.glathe@oldschoolsolutions.biz>
Subject: Re: [PATCH v2 2/5] clk: qcom: common: introduce qcom_cc_sync_state()
Date: Thu, 25 Jun 2026 07:38:42 -0400 [thread overview]
Message-ID: <aj0TQuaPWmSlLwIw@redhat.com> (raw)
In-Reply-To: <21bbffb7-ce99-4c38-a5cc-6a3f3c7f48eb@oss.qualcomm.com>
Hi Konrad,
On Thu, Jun 25, 2026 at 11:44:12AM +0200, Konrad Dybcio wrote:
> On 6/16/26 11:09 PM, 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().
> >
> > Tested-by: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
> > Signed-off-by: Brian Masney <bmasney@redhat.com>
> > ---
> > 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);
>
> As mentioned before, we really need to test for (qcom_cc_desc)->icc_hws
> here
>
> If icc_sync_state() is called without an interconnect provider
> being registered, the framework state gets messed up:
>
> --- drivers/interconnect/core.c
> void icc_sync_state(struct device *dev)
> {
> struct icc_provider *p;
> struct icc_node *n;
> static int count; // function-static variable
>
> count++; // called for every clock controller in this revision
>
> if (count < providers_count) // kaboom
> return;
>
> // actual sync_state never happens anymore
>
> Presumably one would pass this through drvdata, but be careful as
> some drivers use it for other purposes today
My next version of this series that I haven't posted yet allows chaining
the sync_state callbacks at the driver core level. It doesn't require
any of the QC clk driver changes, and will allow us to play nicely with
the pmdomain subsystem, and any others the move to sync_state in the
future.
I think I see the confusion between us the last few rounds of review. In
this series, I added qcom_cc_sync_state() and converted 6 drivers over to
use it. (I excluded clk-cbf-8996.c since it is separate.) Only the 6
drivers today that called icc_sync_state() now call qcom_cc_sync_state() ->
icc_sync_state(). So from my vantage point it is the same overall
functionality.
I didn't look at this from the perspective of qcom_cc_sync_state() would
be common infrastructure, and a newly added driver in the future that may
not interact with the ICC framework may use this. Is this correct?
I asked earlier if this was an existing bug, and the response was no.
Once I fix my x13s today, and able to verify my v3 sync_state still
works as expected, I'll post the new version.
Brian
next prev parent reply other threads:[~2026-06-25 11:38 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 21:09 [PATCH v2 0/5] clk: implement sync_state support Brian Masney
2026-06-16 21:09 ` [PATCH v2 1/5] clk: introduce stub clk_sync_state() Brian Masney
2026-06-16 21:09 ` [PATCH v2 2/5] clk: qcom: common: introduce qcom_cc_sync_state() Brian Masney
2026-06-25 9:44 ` Konrad Dybcio
2026-06-25 11:38 ` Brian Masney [this message]
2026-06-25 12:19 ` Konrad Dybcio
2026-06-25 13:25 ` Brian Masney
2026-06-16 21:09 ` [PATCH v2 3/5] clk: qcom: convert from icc_sync_state() to qcom_cc_sync_state() Brian Masney
2026-06-25 9:44 ` Konrad Dybcio
2026-06-16 21:09 ` [PATCH v2 4/5] clk: qcom: cbf-8996: add clk_sync_state() call Brian Masney
2026-06-25 9:38 ` Konrad Dybcio
2026-06-16 21:09 ` [PATCH v2 5/5] clk: implement sync_state support Brian Masney
2026-06-17 9:25 ` [PATCH " dongxuyang
2026-06-17 14:24 ` [PATCH v2 " Ulf Hansson
2026-06-17 15:02 ` Brian Masney
2026-06-17 15:29 ` Ulf Hansson
2026-06-18 21:12 ` Brian Masney
2026-06-22 10:35 ` Konrad Dybcio
2026-06-22 14:45 ` Brian Masney
2026-06-17 8:10 ` [PATCH v2 0/5] " Neil Armstrong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aj0TQuaPWmSlLwIw@redhat.com \
--to=bmasney@redhat.com \
--cc=abelvesa@kernel.org \
--cc=andersson@kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=jens.glathe@oldschoolsolutions.biz \
--cc=johannes.goede@oss.qualcomm.com \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mripard@kernel.org \
--cc=mturquette@baylibre.com \
--cc=saravanak@kernel.org \
--cc=sboyd@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.