stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: sboyd@codeaurora.org, gregkh@linuxfoundation.org,
	yamada.masahiro@socionext.com
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "clk: Return errors from clk providers in __of_clk_get_from_provider()" has been added to the 4.8-stable tree
Date: Sat, 29 Oct 2016 09:20:06 -0400	[thread overview]
Message-ID: <147774720693131@kroah.com> (raw)


This is a note to let you know that I've just added the patch titled

    clk: Return errors from clk providers in __of_clk_get_from_provider()

to the 4.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     clk-return-errors-from-clk-providers-in-__of_clk_get_from_provider.patch
and it can be found in the queue-4.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From f155d15b64e36b45ca89e3521fe0c1ccad5e5ff0 Mon Sep 17 00:00:00 2001
From: Stephen Boyd <sboyd@codeaurora.org>
Date: Mon, 15 Aug 2016 14:32:23 -0700
Subject: clk: Return errors from clk providers in __of_clk_get_from_provider()

From: Stephen Boyd <sboyd@codeaurora.org>

commit f155d15b64e36b45ca89e3521fe0c1ccad5e5ff0 upstream.

Before commit 0861e5b8cf80 (clk: Add clk_hw OF clk providers,
2016-02-05) __of_clk_get_from_provider() would return an error
pointer of the provider's choosing if there was a provider
registered and EPROBE_DEFER otherwise. After that commit, it
would return EPROBE_DEFER regardless of whether or not the
provider returned an error. This is odd and can lead to behavior
where clk consumers keep probe deferring when they should be
seeing some other error.

Let's restore the previous behavior where we only return
EPROBE_DEFER when there isn't a provider in our of_clk_providers
list. Otherwise, return the error from the last provider we find
that matches the node.

Reported-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Fixes: 0861e5b8cf80 ("clk: Add clk_hw OF clk providers")
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/clk/clk.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -3186,7 +3186,7 @@ struct clk *__of_clk_get_from_provider(s
 {
 	struct of_clk_provider *provider;
 	struct clk *clk = ERR_PTR(-EPROBE_DEFER);
-	struct clk_hw *hw = ERR_PTR(-EPROBE_DEFER);
+	struct clk_hw *hw;
 
 	if (!clkspec)
 		return ERR_PTR(-EINVAL);
@@ -3194,12 +3194,13 @@ struct clk *__of_clk_get_from_provider(s
 	/* Check if we have such a provider in our array */
 	mutex_lock(&of_clk_mutex);
 	list_for_each_entry(provider, &of_clk_providers, link) {
-		if (provider->node == clkspec->np)
+		if (provider->node == clkspec->np) {
 			hw = __of_clk_get_hw_from_provider(provider, clkspec);
-		if (!IS_ERR(hw)) {
 			clk = __clk_create_clk(hw, dev_id, con_id);
+		}
 
-			if (!IS_ERR(clk) && !__clk_get(clk)) {
+		if (!IS_ERR(clk)) {
+			if (!__clk_get(clk)) {
 				__clk_free_clk(clk);
 				clk = ERR_PTR(-ENOENT);
 			}


Patches currently in stable-queue which might be from sboyd@codeaurora.org are

queue-4.8/clk-qoriq-fix-a-register-offset-error.patch
queue-4.8/clk-bcm2835-skip-pllc-clocks-when-deciding-on-a-new-clock-parent.patch
queue-4.8/clk-core-force-setting-the-phase-delay-when-no-change.patch
queue-4.8/clk-return-errors-from-clk-providers-in-__of_clk_get_from_provider.patch
queue-4.8/clk-gcc-msm8996-fix-pcie-2-pipe-register-offset.patch
queue-4.8/clk-divider-fix-clk_divider_round_rate-to-use-clk_readl.patch
queue-4.8/clk-qcom-select-gdsc-for-msm8996-gcc-and-mmcc.patch
queue-4.8/arm-clk-imx35-fix-name-for-ckil-clk.patch

                 reply	other threads:[~2016-10-29 13:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=147774720693131@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=sboyd@codeaurora.org \
    --cc=stable-commits@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=yamada.masahiro@socionext.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).