<div class="gmail_quote">On 9 July 2012 23:57, Mike Turquette <span dir="ltr"><<a href="mailto:mturquette@ti.com" target="_blank">mturquette@ti.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I assume this change has been tested and wouldn't be posted if modifying<br>
the parent names broke things.<br>
<br>
That said, as long as the parent names are valid strings then the clk<br>
framework should handle them.  When calling __clk_lookup for parent name<br>
"none", __clk_lookup will return NULL (of course assuming no one else in<br>
the system registered a clock named "none", which would be silly).  This<br>
is handled gracefully by the clk framework by re-parenting your "sys"<br>
clk from $old_parent to the "orphan" list.<br>
<br>
At the top level, there are basically two clock trees.  The first tree<br>
is "real" clock tree which starts as a list of clocks that set the<br>
CLK_IS_ROOT flag.  The second tree is a tree of "orphans" for clocks<br>
which are defined but "disconnected" from any real root clock (which<br>
might be caused by missing data, etc).<br>
<br>
In general it is OK to declare parent names which might result in your<br>
clock being orphaned.  In practice it is more likely that your data<br>
matches your code: e.g. if you don't support a parent clock in the data<br>
then you likely never try use that missing parent clock in your code.<br>
<br>
The OMAP port does in fact make use of the orphan tree for some clocks,<br>
so it is tested.  However we haven't had any users of the clock tree<br>
which made a lot of use of "dynamic" reparenting to and from the orphan<br>
tree.  I did unit test this back during the 3.4 cycle, but I haven't<br>
since.  Let me know if you have any problems with it.<br></blockquote><div><br></div><div>Hi Mike,</div><div><br></div><div>For example, clk1 have parents pclk1 and pclk2. Register values</div><div>for pclk1 is 0X and for pclk2 is 1X. i.e. pclk1 is selected for both 00 and 01.</div>
<div>And pclk2 is selected for 10 and 11. so, its better to take care of all these situations,</div><div>otherwise there can be corner cases like: In linux we decide to use 00 for pclk1, 10 for</div><div>pclk2 and other two for "none". But bootloader, enabled the clock with 01 for pclk1.</div>
<div>This clock isn't a orphan but it will look like that in our clock tree.</div><div><br></div><div>So, is this OK in the current implementation of clk framework to have parents like</div><div>"pclk1", "pclk1", "pclk2", "pclk2"?</div>
<div><br></div><div>--</div><div>viresh</div></div>