All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
	Douglas Anderson <dianders@chromium.org>,
	Heiko Stuebner <heiko@sntech.de>,
	Jerome Brunet <jbrunet@baylibre.com>
Subject: [PATCH v2 4/4] clk: Bail out when calculating phase fails during clk registration
Date: Wed,  5 Feb 2020 15:28:02 -0800	[thread overview]
Message-ID: <20200205232802.29184-5-sboyd@kernel.org> (raw)
In-Reply-To: <20200205232802.29184-1-sboyd@kernel.org>

Bail out of clk registration if we fail to get the phase for a clk that
has a clk_ops::get_phase() callback. Print a warning too so that driver
authors can easily figure out that some clk is unable to read back phase
information at boot.

Cc: Douglas Anderson <dianders@chromium.org>
Cc: Heiko Stuebner <heiko@sntech.de>
Suggested-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
---
 drivers/clk/clk.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 87532e2d124a..e9e83f7ae9e0 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -3457,7 +3457,12 @@ static int __clk_core_init(struct clk_core *core)
 	 * Since a phase is by definition relative to its parent, just
 	 * query the current clock phase, or just assume it's in phase.
 	 */
-	clk_core_get_phase(core);
+	ret = clk_core_get_phase(core);
+	if (ret < 0) {
+		pr_warn("%s: Failed to get phase for clk '%s'\n", __func__,
+			core->name);
+		goto out;
+	}
 
 	/*
 	 * Set clk's duty cycle.
-- 
Sent by a computer, using git, on the internet


  parent reply	other threads:[~2020-02-05 23:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05 23:27 [PATCH v2 0/4] clk_phase error caching problems Stephen Boyd
2020-02-05 23:27 ` [PATCH v2 1/4] clk: Don't cache errors from clk_ops::get_phase() Stephen Boyd
2020-02-06  8:26   ` Jerome Brunet
2020-02-12 23:27     ` Stephen Boyd
2020-02-12 23:28   ` Stephen Boyd
2020-02-05 23:28 ` [PATCH v2 2/4] clk: Use 'parent' to shorten lines in __clk_core_init() Stephen Boyd
2020-02-12 23:28   ` Stephen Boyd
2020-02-05 23:28 ` [PATCH v2 3/4] clk: Move rate and accuracy recalc to mostly consumer APIs Stephen Boyd
2020-02-12 23:28   ` Stephen Boyd
2020-02-05 23:28 ` Stephen Boyd [this message]
2020-02-12 23:28   ` [PATCH v2 4/4] clk: Bail out when calculating phase fails during clk registration Stephen Boyd
2020-02-06  8:27 ` [PATCH v2 0/4] clk_phase error caching problems Jerome Brunet

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=20200205232802.29184-5-sboyd@kernel.org \
    --to=sboyd@kernel.org \
    --cc=dianders@chromium.org \
    --cc=heiko@sntech.de \
    --cc=jbrunet@baylibre.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.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 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.