linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* of_clk_add_(hw_)providers multipule times for one node?
@ 2016-07-08 17:23 Masahiro Yamada
  2016-08-04 21:25 ` Stephen Boyd
  0 siblings, 1 reply; 13+ messages in thread
From: Masahiro Yamada @ 2016-07-08 17:23 UTC (permalink / raw)
  To: linux-clk, Stephen Boyd, Michael Turquette; +Cc: Linux Kernel Mailing List

Hi.

I think the current code allows to add
clk_providers multiple times against one DT node.

Are there cases that really need to do so?


I am thinking the behavior of __of_clk_get_from_provider() is strange.


The result of __of_clk_get_from_provider() has three patterns:

[1] success
[2] return -EPROBE_DEFER
[3] return -EINVAL  (if clkspec == NULL)


[3] is a rare case.
So, almost all error cases are treated as -EPROBE_DEFER.



A strange scenario
------------------

If a too big clock index is passed in clkspec,
of_clk_src_onecell_get() returns -EINVAL. This is reasonable.


But, __of_clk_get_from_provider() tries to search next nodes despite
that it has already failed to get a clk.

Then, it reaches the end of list_for_each_entry() loop, and returns
-EPROBE_DEFER.  This is not deferred probe at all!  In this case,
__of_clk_get_from_provider() should return -EINVAL.


If this is a bug, I am happy to volunteer to fix it.


Thanks.



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-08-25 20:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-08 17:23 of_clk_add_(hw_)providers multipule times for one node? Masahiro Yamada
2016-08-04 21:25 ` Stephen Boyd
2016-08-04 22:02   ` Rob Herring
2016-08-07 16:54   ` Masahiro Yamada
2016-08-08  9:00     ` Geert Uytterhoeven
2016-08-08 23:37     ` Stephen Boyd
2016-08-10  7:59       ` Masahiro Yamada
2016-08-10 23:08         ` Stephen Boyd
2016-08-12  7:04           ` Masahiro Yamada
2016-08-24  7:11             ` Masahiro Yamada
2016-08-24 18:08               ` Stephen Boyd
2016-08-25  2:36                 ` Masahiro Yamada
2016-08-25 20:30                   ` Stephen Boyd

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).