All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: linux-clk@vger.kernel.org, Stephen Boyd <sboyd@codeaurora.org>,
	Michael Turquette <mturquette@baylibre.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: of_clk_add_(hw_)providers multipule times for one node?
Date: Sat, 9 Jul 2016 02:23:29 +0900	[thread overview]
Message-ID: <CAK7LNAQ5uRoSEEuKys9Gs-2HFAJCbmnFDjxajWfK9ng_dtZ8yw@mail.gmail.com> (raw)

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

             reply	other threads:[~2016-07-08 17:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-08 17:23 Masahiro Yamada [this message]
2016-08-04 21:25 ` of_clk_add_(hw_)providers multipule times for one node? 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

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=CAK7LNAQ5uRoSEEuKys9Gs-2HFAJCbmnFDjxajWfK9ng_dtZ8yw@mail.gmail.com \
    --to=yamada.masahiro@socionext.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.