mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Brian Masney <bmasney@redhat.com>,
	Ulf Hansson <ulf.hansson@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 5/5] clk: implement sync_state support
Date: Mon, 22 Jun 2026 12:35:32 +0200	[thread overview]
Message-ID: <4d25f656-1372-4ddb-9e52-8f381700abed@oss.qualcomm.com> (raw)
In-Reply-To: <ajRfSbkAYusH5H9H@redhat.com>

On 6/18/26 11:12 PM, Brian Masney wrote:
> Hi Ulf,
> 
> On Wed, Jun 17, 2026 at 05:29:51PM +0200, Ulf Hansson wrote:
>> On Wed, Jun 17, 2026 at 5:02 PM Brian Masney <bmasney@redhat.com> wrote:
>>> On Wed, Jun 17, 2026 at 04:24:05PM +0200, Ulf Hansson wrote:
>>>> On Tue, Jun 16, 2026 at 11:09 PM Brian Masney <bmasney@redhat.com> wrote:
>>>>> @@ -4345,8 +4382,17 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw)
>>>>>         core->dev = dev;
>>>>>         clk_pm_runtime_init(core);
>>>>>         core->of_node = np;
>>>>> -       if (dev && dev->driver)
>>>>> +       if (dev && dev->driver) {
>>>>>                 core->owner = dev->driver->owner;
>>>>> +
>>>>> +               /*
>>>>> +                * If a clk provider sets their own sync_state, then it needs to
>>>>> +                * also call clk_sync_state(). dev_set_drv_sync_state() won't
>>>>> +                * overwrite the sync_state callback, and this call will fail
>>>>> +                * with -EBUSY.
>>>>> +                */
>>>>> +               dev_set_drv_sync_state(dev, clk_sync_state);
>>>>
>>>> We have cases where a device node represents a provider for multiple
>>>> types of resources, like clocks, power-domains (genpds), resets, etc,
>>>> as in the qcom case, for example.
>>>>
>>>> For power-domain provider drivers (genpd) we also try to assign the
>>>> ->sync_state() callback, see of_genpd_add_provider_simple() and
>>>> of_genpd_add_provider_simple(). This means the above doesn't play well
>>>> with how genpd behaves, so we need to figure out a way to manage these
>>>> cases.
>>>>
>>>> In this regard, we also have of_genpd_sync_state(), which allows a
>>>> genpd provider driver to explicitly call genpd's sync state function,
>>>> if/when needed.
>>>>
>>>> Unfortunately I am not able to suggest a detailed solution for how to
>>>> move this forward at this point, as it requires some more thinking and
>>>> I am heading for some vacation very soon.
>>>
>>> One approach I initially considered was to make it so that we can have a
>>> list of sync_state callbacks that can be added to. I already did some
>>> work on this, but I didn't think it was worth it for just the QC clk
>>> drivers in isolation, but it would address the concern here.
>>
>> Right, maybe that would work.
>>
>> One more thing to somewhat consider, is the problem I have been trying
>> to address for power-domains providers [1]. At least for genpd
>> providers, we need a more fine grained sync state solution, which also
>> must be able to co-exists with other subsystems sync state support. I
>> am not sure if something like this is needed for clocks too?
>>
>> [1]
>> https://lore.kernel.org/all/20260508123910.114273-1-ulf.hansson@linaro.org/
> 
> I am not aware of any clks setup that way but that's not to say they don't
> exist. Stephen, and/or some of the folks from QC would know better.

I'm not sure I'm following, but we do have this bit

qcom_cc_probe()
 -> qcom_cc_really_probe()
    -> gdsc_register()
      -> of_genpd_add_provider_onecell()
        -> dev_set_drv_sync_state()

and this patch calls dev_set_drv_sync_state() again in __clk_register()

Konrad


  reply	other threads:[~2026-06-22 10:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-16 21:09 [PATCH v2 0/5] " 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
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-29 18:37     ` Krzysztof Kozlowski
2026-06-30  8:57       ` Xuyang Dong
2026-06-30  9:01         ` Krzysztof Kozlowski
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 [this message]
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=4d25f656-1372-4ddb-9e52-8f381700abed@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=abelvesa@kernel.org \
    --cc=andersson@kernel.org \
    --cc=bmasney@redhat.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=jens.glathe@oldschoolsolutions.biz \
    --cc=johannes.goede@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 \
    --cc=ulf.hansson@oss.qualcomm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®