devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Nishanth Menon <nm@ti.com>
Cc: linux-omap@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	"Benoît Cousson" <b-cousson@ti.com>,
	"Tony Lindgren" <tony@atomide.com>,
	"Paul Walmsley" <paul@pwsan.com>,
	"Kevin Hilman" <khilman@deeprootsystems.com>,
	"Mike Turquette" <mturquette@linaro.org>
Subject: Re: [PATCH V4 1/6] clk: OMAP: introduce device tree binding to kernel clock data
Date: Mon, 15 Apr 2013 10:22:37 -0600	[thread overview]
Message-ID: <516C294D.6070700@wwwdotorg.org> (raw)
In-Reply-To: <1365807278-554-2-git-send-email-nm@ti.com>

On 04/12/2013 04:54 PM, Nishanth Menon wrote:
> OMAP clock data is located in arch/arm/mach-omap2/cclockXYZ_data.c.
> However, this presents an obstacle for using these clock nodes in
> Device Tree definitions. This is especially true for board specific
> clocks initially. The fixed clocks are currently found via clock
> aliases table. There are many possible approaches to this problem as
> discussed in the following thread:
> http://marc.info/?t=136370325600009&r=1&w=2.
> Highlights of the options:
> a) device specific clk_add_alias:
>    cons: driver handling required
> b) using an generic clk node and indexing to reach the clock required.
>    This is similar in approach taken by tegra and few other platforms.
>    Example usage: clock = <&clk 5>;
>    cons: potential to have mismatches in indexed table and associated
>    dtb data. In addition, managing continued documentation in bindings
>    as clock indexing increases. Even though readability angle could be
>    improved by using preprocessing of DT using macros, indexed
>    approach is inherently risky from cases like the following:
>    clk indexes in kernel:
>    1 - mpu_dpll
>    2 - aux_clk1
>    3 - core_clk
>    DT entry for peripheral X uses <&clk 2> to reach aux_clk1. Now, let's
>    say kernel updates indices to:
>    1 - mpu_dpll
>    2 - per_dpll
>    3 - aux_clk1
>    4 - core_clk
>    using the old dtb(or dts missing an update), on new kernel which
>    has updated indices will result in per_dpll now controlled for
>    peripheral X without warning or any potential error detection.
> 
>    Even though we could claim this is user error, such errors are hard
>    to track down and fix.

The error in case (b) is that you shouldn't be changing the DT bindings
after they've first been created. That would avoid the problem
situation. The person using the old DTB with the new kernel didn't
commit user error.

> An alternate approach introduced here is to introduce device tree
> bindings corresponding to the clock nodes required in DT definition
> for SoC which automatically maps back to the definitions in
> cclockXYZ_data.c.

Well, I haven't read the patches, but isn't that exactly what the "2" is
in <&clk 2>?

  parent reply	other threads:[~2013-04-15 16:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12 22:54 [PATCH V4 0/6] ARM: OMAP3+: support cpufreq-cpu0 for device tree boot Nishanth Menon
     [not found] ` <1365807278-554-1-git-send-email-nm-l0cyMroinI0@public.gmane.org>
2013-04-12 22:54   ` [PATCH V4 1/6] clk: OMAP: introduce device tree binding to kernel clock data Nishanth Menon
2013-04-12 23:31     ` Tony Lindgren
     [not found]       ` <20130412233142.GE10155-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2013-04-12 23:39         ` Nishanth Menon
2013-04-13 17:22           ` Tony Lindgren
     [not found]             ` <20130413172210.GM10155-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2013-04-14 21:19               ` Nishanth Menon
2013-04-24 16:28                 ` Mike Turquette
2013-04-25  7:01                   ` Rajendra Nayak
2013-04-15 16:22     ` Stephen Warren [this message]
2013-04-15 18:43       ` Nishanth Menon
2013-04-12 22:54   ` [PATCH V4 3/6] ARM: dts: OMAP4: add clock nodes for CPU Nishanth Menon
2013-04-12 22:54 ` [PATCH V4 2/6] ARM: dts: OMAP3: " Nishanth Menon
2013-04-12 22:54 ` [PATCH V4 4/6] ARM: dts: AM33XX: " Nishanth Menon
2013-04-12 22:54 ` [PATCH V4 5/6] ARM: OMAP2+: AM33XX: add lateinit hook for calling pm late init Nishanth Menon
2013-04-12 22:54 ` [PATCH V4 6/6] ARM: OMAP3+: use cpu0-cpufreq driver in device tree supported boot Nishanth Menon

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=516C294D.6070700@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=b-cousson@ti.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mturquette@linaro.org \
    --cc=nm@ti.com \
    --cc=paul@pwsan.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).