linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tero Kristo <t-kristo@ti.com>
To: Tomasz Figa <tomasz.figa@gmail.com>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>,
	linux-omap@vger.kernel.org, paul@pwsan.com, tony@atomide.com,
	nm@ti.com, rnayak@ti.com, mturquette@linaro.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	Stephen Warren <swarren@wwwdotorg.org>,
	Mark Rutland <Mark.Rutland@arm.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	Pawel Moll <pawel.moll@arm.com>
Subject: Re: [PATCHv5 01/31] CLK: clkdev: add support for looking up clocks from DT
Date: Mon, 19 Aug 2013 12:12:48 +0300	[thread overview]
Message-ID: <5211E190.1060604@ti.com> (raw)
In-Reply-To: <6776624.q5Zt0hTc0G@flatron>

Hey,

(Sorry was out for a short vacation, thus late reply.)

On 08/03/2013 10:04 PM, Tomasz Figa wrote:
> On Saturday 03 of August 2013 19:48:05 Russell King - ARM Linux wrote:
>> On Sat, Aug 03, 2013 at 08:39:34PM +0200, Tomasz Figa wrote:
>>> Hi Russell,
>>>
>>> On Saturday 03 of August 2013 19:35:43 Russell King - ARM Linux wrote:
>>>> On Sat, Aug 03, 2013 at 04:02:36PM +0200, Tomasz Figa wrote:
>>>>>> +	if (cl)
>>>>>> +		return cl;
>>>>>> +
>>>>>> +	/* If clock was not found, attempt to look-up from DT */
>>>>>> +	node = of_find_node_by_name(NULL, con_id);
>>>>>
>>>>> Why are we introducing the "lookup by name" brokenness to the yet
>>>>> (mostly) sane DT world?
>>>>>
>>>>> We already have a good way of binding things together in DT, which
>>>>> is
>>>>> using phandles.
>>>>>
>>>>> Not even saying that this (or something this patch relies on)
>>>>> breaks
>>>>> the ePAPR recommendation about node naming, which states that node
>>>>> names should not be used to convey platform-specific data, but
>>>>> instead should be as generic as possible to show what kind of
>>>>> hardware is represented by the node.
>>>>
>>>> Tell me this: many devices name their clock inputs.  You can find
>>>> these
>>>> input names in data sheets and the like.  These are the names
>>>> defined
>>>> by the hardware.  What is wrong about using those names in DT?
>>>
>>> Yes, clock inputs. But this is about lookup by clock name, not clock
>>> input name, as far as I can tell from the patch, based on looking for
>>> a node with given name over the whole DT.
>>
>> "con_id" is supposed to be the clock input name when the clock API is
>> used correctly.
>
> Right. Still, the code is looking for a node with the same name as the
> supposed input name, which seems strange to me, because clock input names
> are supposed to be defined in consumer's node, inside clock-names
> property.
>
>>>> Remember that the second argument to clk_get() is the _clock_
>>>> _input_
>>>> _name_ on the _device_ passed in the first argument.  It is not
>>>> *ever*
>>>> some random name of the clock producer unless someone's fscked up
>>>> their
>>>> use of this API (in which case they're the ones with the problem.)
>>>
>>> This is perfectly fine and this is how the generic common clock
>>> framework DT bindings work - clock-names property is a list of clock
>>> input names and clocks property contain specifiers of respective
>>> clocks.
>>
>> There seems to be a some pressure to do clk_get()->of_clk_get()
>> conversions, and also to find ways to lookup clocks.
>
> I don't really see any need for this kind of conversion. clk_get() already
> handles lookup using DT correctly and from drivers perspective nothing
> changes.
>
>> It seems to me
>> that no one understands how DT handles clocks.  Maybe that's where the
>> problem is - lack of documentation about how DT clocks are handled.
>
> Hmm, there is pretty much of description and examples in
>
> Documentation/devicetree/bindings/clock/clock-bindings.txt
>
> For me it was enough to learn how DT based clock lookup works, but I'm
> quite used to DT, so I'm not a good test sample.
>
> Best regards,
> Tomasz
>

I think based on these comments this patch needs to go away, I will have 
to find another way to map the devices in and to avoid supporting the 
legacy mappings (hwmod depends on this heavily atm, but Rajendra posted 
some patches to address this.) I'll see what I can do for next rev. I 
might implement some tweak inside the OMAP codebase for this.

-Tero


  reply	other threads:[~2013-08-19  9:13 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-02 16:25 [PATCHv5 00/31] CLK: OMAP conversion to DT Tero Kristo
2013-08-02 16:25 ` [PATCHv5 01/31] CLK: clkdev: add support for looking up clocks from DT Tero Kristo
2013-08-03 14:02   ` Tomasz Figa
2013-08-03 18:35     ` Russell King - ARM Linux
2013-08-03 18:39       ` Tomasz Figa
2013-08-03 18:48         ` Russell King - ARM Linux
2013-08-03 19:04           ` Tomasz Figa
2013-08-19  9:12             ` Tero Kristo [this message]
2013-08-03 18:31   ` Russell King - ARM Linux
2013-08-26 14:36     ` Tero Kristo
2013-08-26 17:03       ` Russell King - ARM Linux
2013-08-26 18:12         ` Tero Kristo
2013-08-27  6:55           ` Tony Lindgren
2013-08-02 16:25 ` [PATCHv5 02/31] CLK: TI: Add DPLL clock support Tero Kristo
2013-08-13 10:50   ` Mark Rutland
2013-08-19 13:34     ` Tero Kristo
2013-08-19 14:18       ` Mark Rutland
2013-08-19 15:09         ` Tero Kristo
2013-08-19 16:24           ` Mark Rutland
2013-08-19 17:06             ` Tero Kristo
2013-08-19 22:00               ` Mike Turquette
2013-08-21 16:16                 ` Tero Kristo
2013-08-22  8:04                   ` Mike Turquette
2013-08-02 16:25 ` [PATCHv5 03/31] CLK: TI: add DT alias clock registration mechanism Tero Kristo
2013-08-02 16:25 ` [PATCHv5 04/31] CLK: TI: add autoidle support Tero Kristo
2013-08-02 16:25 ` [PATCHv5 05/31] CLK: TI: add support for OMAP gate clock Tero Kristo
2013-08-13 11:04   ` Mark Rutland
2013-08-19 13:42     ` Tero Kristo
2013-08-19 14:29       ` Mark Rutland
2013-08-19 14:43         ` Tero Kristo
2013-08-19 15:58           ` Mark Rutland
2013-08-19 16:19             ` Tero Kristo
2013-08-02 16:25 ` [PATCHv5 06/31] ARM: dts: omap4 clock data Tero Kristo
2013-08-03 14:16   ` Tomasz Figa
2013-08-19 13:43     ` Tero Kristo
2013-08-02 16:25 ` [PATCHv5 07/31] CLK: TI: add omap4 clock init file Tero Kristo
2013-08-05  7:27   ` Tony Lindgren
2013-08-19 13:46     ` Tero Kristo
2013-08-02 16:25 ` [PATCHv5 08/31] ARM: OMAP4: remove old clock data and link in new clock init code Tero Kristo
2013-08-02 16:25 ` [PATCHv5 09/31] ARM: dts: omap5 clock data Tero Kristo
2013-08-02 16:25 ` [PATCHv5 10/31] CLK: TI: add omap5 clock init file Tero Kristo
2013-08-02 16:25 ` [PATCHv5 11/31] CLK: TI: omap5: Initialize USB_DPLL at boot Tero Kristo
2013-08-02 16:25 ` [PATCHv5 12/31] ARM: dts: dra7 clock data Tero Kristo
2013-08-02 16:25 ` [PATCHv5 13/31] ARM: dts: clk: Add apll related clocks Tero Kristo
2013-08-02 16:25 ` [PATCHv5 14/31] ARM: dts: DRA7: Change apll_pcie_m2_ck to fixed factor clock Tero Kristo
2013-08-02 16:25 ` [PATCHv5 15/31] ARM: dts: DRA7: Add PCIe related clock nodes Tero Kristo
2013-08-02 16:25 ` [PATCHv5 16/31] CLK: TI: DRA7: Add APLL support Tero Kristo
2013-08-13 11:14   ` Mark Rutland
2013-08-19 13:52     ` Tero Kristo
2013-08-20  4:09       ` Keerthy
2013-08-02 16:25 ` [PATCHv5 17/31] CLK: TI: add dra7 clock init file Tero Kristo
2013-08-02 16:25 ` [PATCHv5 18/31] CLK: DT: add support for set-rate-parent flag Tero Kristo
2013-08-13 11:25   ` Mark Rutland
2013-08-02 16:25 ` [PATCHv5 19/31] ARM: dts: am33xx clock data Tero Kristo
2013-08-02 16:25 ` [PATCHv5 20/31] CLK: TI: add am33xx clock init file Tero Kristo
2013-08-02 16:25 ` [PATCHv5 21/31] ARM: AM33xx: remove old clock data and link in new clock init code Tero Kristo
2013-08-02 16:25 ` [PATCHv5 22/31] CLK: TI: add interface clock support for OMAP3 Tero Kristo
2013-08-13 11:30   ` Mark Rutland
2013-08-19 13:54     ` Tero Kristo
2013-08-02 16:25 ` [PATCHv5 23/31] ARM: OMAP: hwmod: fix an incorrect clk type cast with _get_clkdm Tero Kristo
2013-08-02 16:25 ` [PATCHv5 24/31] CLK: TI: gate: add support for OMAP36xx dpllx_mx_ck:s Tero Kristo
2013-08-02 16:25 ` [PATCHv5 25/31] ARM: OMAP3: hwmod: initialize clkdm from clkdm_name Tero Kristo
2013-08-02 16:25 ` [PATCHv5 26/31] ARM: dts: omap3 clock data Tero Kristo
2013-08-02 16:25 ` [PATCHv5 27/31] CLK: TI: add omap3 clock init file Tero Kristo
2013-08-02 16:25 ` [PATCHv5 28/31] ARM: dts: AM35xx clock data Tero Kristo
2013-08-02 16:25 ` [PATCHv5 29/31] ARM: dts: AM35xx: use DT " Tero Kristo
2013-08-02 16:25 ` [PATCHv5 30/31] ARM: OMAP3: use DT clock init if DT data is available Tero Kristo
2013-08-02 16:25 ` [PATCHv5 31/31] ARM: dts: am43xx clock data Tero Kristo

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=5211E190.1060604@ti.com \
    --to=t-kristo@ti.com \
    --cc=Mark.Rutland@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=ian.campbell@citrix.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mturquette@linaro.org \
    --cc=nm@ti.com \
    --cc=paul@pwsan.com \
    --cc=pawel.moll@arm.com \
    --cc=rnayak@ti.com \
    --cc=swarren@wwwdotorg.org \
    --cc=tomasz.figa@gmail.com \
    --cc=tony@atomide.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;
as well as URLs for NNTP newsgroup(s).