From: Tero Kristo <t-kristo@ti.com>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: <mturquette@baylibre.com>, <linux-clk@vger.kernel.org>,
<ssantosh@kernel.org>, <devicetree@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <nm@ti.com>
Subject: Re: [PATCHv2 3/3] clk: keystone: Add sci-clk driver support
Date: Fri, 23 Sep 2016 11:06:04 +0300 [thread overview]
Message-ID: <9f71ab9b-7aed-ae6f-c057-ed3da0bd5200@ti.com> (raw)
In-Reply-To: <20160916230101.GM7243@codeaurora.org>
On 17/09/16 02:01, Stephen Boyd wrote:
> On 09/05, Tero Kristo wrote:
>> On 03/09/16 02:32, Stephen Boyd wrote:
>>> I still don't get it. We should be registering hw pointers in
>>> probe and handing them out in the xlate function. Not register
>>> hws in the xlate function and then handing them out as well. I
>>> haven't reviewed anything else in this patch.
>>
>> Ok, let me try to explain the functionality.
>>
>> Probe time hw pointer registration is only needed for special clocks
>> that require extra flags, like adding the spread spectrum flag.
>> There is ever going to be only handful of these.
>>
>> Xlate checks out the sci_clk list, and picks up an existing hw clock
>> if it is there. If not, it will create a new one. The reason this is
>> done like this, the device IDs / clock IDs don't mean anything to
>> the driver itself, the driver just passes these forward to the
>> underlying SCI fwk. And, we don't have inherent knowledge of valid
>> device / clock IDs either, the SCI fwk returns a failure if a
>> specific clock ID is bad. The device / clock IDs are going to be
>> different between different generations of SoC also, and in addition
>> there can be holes in the ID ranges.
>
> Ok. Thanks for the explanation.
>
> I understand the desire to make this SoC agnostic and consumer/dt
> driven. Constructor pattern and all. Unfortunately the OF clk
> provider is a getter pattern; not a constructor pattern. I'm
> seriously concerned about the locking here because we're in the
> framework creating a clk and tying it into a consumer list which
> could cause all sorts of problems if we want to reenter the
> framework and register more clks. Recursion abounds and my head
> explodes! The recursive clk prepare mutex is not something anyone
> should be thrilled about keeping around.
>
> So, just don't do this. Instead, register the clks during probe
> that exist for the firmware. That list could be discoverable with
> firmware calls, or known based on different compatible strings
> from DT that have the soc name in it, or something else. Even
> scanning the entire DT tree for
>
> clocks = <&my_clk_node x y>
>
> would be better, but probably hugely inefficient and outright
> buggy with DT overlays so don't do it. If the firmware can't tell
> us what clks are there, just have a table based on compatible
> string and be done.
Ok, I will add a static mapping of valid clock IDs within the driver and
init all of these during probe. I have a working solution for this
already, but will post it out only once 4.9-rc1 is out.
-Tero
prev parent reply other threads:[~2016-09-23 8:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-01 12:40 [PATCHv2 0/3] ARM: K2G: support for TI-SCI Clocks Tero Kristo
2016-09-01 12:40 ` [PATCHv2 1/3] Documentation: dt: Add TI SCI clock driver Tero Kristo
2016-09-12 13:10 ` Rob Herring
2016-09-23 8:04 ` Tero Kristo
2016-09-01 12:40 ` [PATCHv2 2/3] dt-binding: clock: Add k2g clock definitions Tero Kristo
2016-09-01 12:40 ` [PATCHv2 3/3] clk: keystone: Add sci-clk driver support Tero Kristo
2016-09-02 23:32 ` Stephen Boyd
2016-09-05 7:07 ` Tero Kristo
2016-09-16 23:01 ` Stephen Boyd
2016-09-23 8:06 ` Tero Kristo [this message]
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=9f71ab9b-7aed-ae6f-c057-ed3da0bd5200@ti.com \
--to=t-kristo@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=nm@ti.com \
--cc=sboyd@codeaurora.org \
--cc=ssantosh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox