All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vaittinen, Matti" <Matti.Vaittinen@fi.rohmeurope.com>
To: Marek Vasut <marex@denx.de>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>
Cc: Michael Turquette <mturquette@baylibre.com>,
	Rob Herring <robh+dt@kernel.org>, Stephen Boyd <sboyd@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	linux-power <linux-power@rohmsemiconductoreurope.onmicrosoft.com>
Subject: Re: [PATCH 2/3] clk: Introduce 'critical-clocks' property
Date: Thu, 17 Feb 2022 05:01:34 +0000	[thread overview]
Message-ID: <88ee0a11-359e-60a5-4d96-54fef6514e69@fi.rohmeurope.com> (raw)
In-Reply-To: <8083fbfb-d039-a7c8-7c08-c57ebf9e3b56@denx.de>

On 2/16/22 18:52, Marek Vasut wrote:
> On 2/16/22 13:06, Vaittinen, Matti wrote:
> 
> Hi,
> 
> [...]
> 
>>> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
>>> index 8de6a22498e70..1e1686fa76e01 100644
>>> --- a/drivers/clk/clk.c
>>> +++ b/drivers/clk/clk.c
>>> @@ -3872,6 +3872,45 @@ static void clk_core_free_parent_map(struct 
>>> clk_core *core)
>>>        kfree(core->parents);
>>>    }
>>> +static void
>>> +__clk_register_critical_clock(struct device_node *np, struct 
>>> clk_core *core,
>>> +                  struct clk_hw *hw)
>>> +{
>>> +    struct of_phandle_args clkspec;
>>> +    u32 clksize, clktotal;
>>> +    int ret, i, index;
>>> +
>>> +    if (!np)
>>> +        return;
>>> +
>>> +    if (!core->ops->match_clkspec)
>>> +        return;
>>> +
>>> +    if (of_property_read_u32(np, "#clock-cells", &clksize))
>>> +        return;
>>> +
>>> +    /* Clock node with #clock-cells = <0> uses critical-clocks; */
>>> +    if (clksize == 0) {
>>> +        if (of_property_read_bool(np, "critical-clocks") &&
>>> +            !core->ops->match_clkspec(hw, &clkspec))
>>
>> I think this is never true as there is
>> if (!core->ops->match_clkspec)
>>     return;
>>
>> above.
> 
> If the driver implements match_clkspec() callback, then the callback 
> gets used here to determine whether the clock match this clkspec.

/me feels _utterly_ stupid.

Of course :) I somehow completely misread the code. Sorry for the noise!

>> Anyways, seeing you added a dummy bd71837_match_clkspec in a follow-up
>> patch for BD71837 - which has only single clock - I wonder if there is a
>> way to omit that dummy callback in controllers which really provide only
>> one clock?
> 
> Yes, I think we can omit the match_clkspec call for clock controllers 
> with clock-cells == 0 altogether.

That would mean you could probably drop the bd718x7 driver patch, right?


Best Regards
	-- Matti

-- 
The Linux Kernel guy at ROHM Semiconductors

Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~ this year is the year of a signature writers block ~~

  reply	other threads:[~2022-02-17  5:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15  8:44 [PATCH 1/3] dt-bindings: clk: Introduce 'critical-clocks' property Marek Vasut
2022-02-15  8:44 ` [PATCH 2/3] " Marek Vasut
2022-02-15 11:23   ` kernel test robot
2022-02-15 11:23     ` kernel test robot
2022-02-15 13:57   ` kernel test robot
2022-02-15 13:57     ` kernel test robot
2022-02-16 12:06   ` Vaittinen, Matti
2022-02-16 16:52     ` Marek Vasut
2022-02-17  5:01       ` Vaittinen, Matti [this message]
2022-02-17 13:43         ` Marek Vasut
2022-02-17 22:23   ` Stephen Boyd
2022-02-21  0:58     ` Marek Vasut
2022-03-09 20:54       ` Marek Vasut
2022-03-12  5:04         ` Stephen Boyd
2022-03-12 10:26           ` Marek Vasut
2022-03-15 23:52             ` Stephen Boyd
2022-03-16 11:30               ` Marek Vasut
2022-05-03 19:17                 ` Marek Vasut
2022-02-15  8:44 ` [PATCH 3/3] clk: bd718xx: Implement basic .match_clkspec Marek Vasut
2022-02-15 20:55 [PATCH 2/3] clk: Introduce 'critical-clocks' property kernel test robot

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=88ee0a11-359e-60a5-4d96-54fef6514e69@fi.rohmeurope.com \
    --to=matti.vaittinen@fi.rohmeurope.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-power@rohmsemiconductoreurope.onmicrosoft.com \
    --cc=marex@denx.de \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@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.