linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mturquette@ti.com (Mike Turquette)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] Clk: SPEAr1340: fix sys clock parent source and corresponding mask value
Date: Mon, 9 Jul 2012 15:57:00 -0700	[thread overview]
Message-ID: <20120709225700.GB16202@gmail.com> (raw)
In-Reply-To: <CAOh2x=k5Tx2Gjrk1uRod-N-6gvYSeEKiZgms8gQfJ61TL8RXCQ@mail.gmail.com>

On 20120709-13:34, viresh kumar wrote:
> On Mon, Jul 9, 2012 at 1:04 PM, vipul kumar samar
> <vipulkumar.samar@st.com> wrote:
> > On 7/9/2012 4:34 PM, viresh kumar wrote:
> >>
> >> On Mon, Jul 9, 2012 at 11:31 AM, Shiraz Hashim<shiraz.hashim@st.com>
> >> wrote:
> >>>
> >>> From: Vipul Kumar Samar<vipulkumar.samar@st.com>
> >>>
> >>> sys_clk have multiple parents and selection of parent is depends on
> >>
> >>
> >> s/ is//
> 
> I hope you haven't missed this comment :)
> 
> >>>   static const char *vco_parents[] = { "osc_24m_clk", "osc_25m_clk", };
> >>> -static const char *sys_parents[] = { "none", "pll1_clk", "none", "none",
> >>> -       "sys_synth_clk", "none", "pll2_clk", "pll3_clk", };
> >>> +static const char *sys_parents[] = { "pll1_clk", "pll1_clk", "pll1_clk",
> >>> +       "pll1_clk", "sys_synth_clk", "sys_synth_clk", "pll2_clk",
> >>> "pll3_clk", };
> >>
> >>
> >> Don't know what would be the implication of this?
> >>
> >> @Mike: Can you please tell us what should we do in such cases?
> >>
> >
> > Is there any other solution for such cases ???
> 
> That's what i have asked mike for :)
> Probably you can go through the clock framework code and check how these
> names are used. Shouldn't be too complex to understand.
> 

I assume this change has been tested and wouldn't be posted if modifying
the parent names broke things.

That said, as long as the parent names are valid strings then the clk
framework should handle them.  When calling __clk_lookup for parent name
"none", __clk_lookup will return NULL (of course assuming no one else in
the system registered a clock named "none", which would be silly).  This
is handled gracefully by the clk framework by re-parenting your "sys"
clk from $old_parent to the "orphan" list.

At the top level, there are basically two clock trees.  The first tree
is "real" clock tree which starts as a list of clocks that set the
CLK_IS_ROOT flag.  The second tree is a tree of "orphans" for clocks
which are defined but "disconnected" from any real root clock (which
might be caused by missing data, etc).

In general it is OK to declare parent names which might result in your
clock being orphaned.  In practice it is more likely that your data
matches your code: e.g. if you don't support a parent clock in the data
then you likely never try use that missing parent clock in your code.

The OMAP port does in fact make use of the orphan tree for some clocks,
so it is tested.  However we haven't had any users of the clock tree
which made a lot of use of "dynamic" reparenting to and from the orphan
tree.  I did unit test this back during the 3.4 cycle, but I haven't
since.  Let me know if you have any problems with it.

Regards,
Mike

> --
> viresh
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2012-07-09 22:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-09 10:31 [PATCH 1/6] ARM: DTS: SPEAr13xx: Fix Interrupt bindings Shiraz Hashim
2012-07-09 10:31 ` [PATCH 2/6] clk: SPEAr1340: Fix clk enable register for uart1 and i2c1 Shiraz Hashim
2012-07-09 10:55   ` viresh kumar
2012-07-09 10:31 ` [PATCH 3/6] clk: SPEAr13xx: Add localtimer (twd) clock support Shiraz Hashim
2012-07-09 10:57   ` viresh kumar
2012-07-09 10:31 ` [PATCH 4/6] Clk: SPEAr13xx: Initialize con_id for Ethernet phy clks Shiraz Hashim
2012-07-09 10:58   ` viresh kumar
2012-07-09 10:31 ` [PATCH 5/6] Clk: SPEAr1340: fix sys clock parent source and corresponding mask value Shiraz Hashim
2012-07-09 11:04   ` viresh kumar
2012-07-09 12:04     ` vipul kumar samar
2012-07-09 12:34       ` viresh kumar
2012-07-09 22:57         ` Mike Turquette [this message]
2012-07-10  8:21           ` Viresh Kumar
2012-07-11 20:11             ` Mike Turquette
2012-07-10  8:52           ` Shiraz Hashim
2012-07-09 10:53 ` [PATCH 1/6] ARM: DTS: SPEAr13xx: Fix Interrupt bindings viresh kumar
2012-07-09 11:18 ` [PATCH 6/6] ARM: SPEAr13xx: Add auxdata for Ethernet controller Shiraz Hashim
2012-07-09 11:30   ` viresh kumar
2012-07-09 12:29     ` vipul kumar samar

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=20120709225700.GB16202@gmail.com \
    --to=mturquette@ti.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).