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,
Jerome Brunet <jbrunet@baylibre.com>,
Guenter Roeck <linux@roeck-us.net>
Subject: Re: [PATCH] clk: Warn about critical clks that fail to enable
Date: Mon, 30 Dec 2019 09:55:17 -0800 [thread overview]
Message-ID: <20191230175517.D2CC620718@mail.kernel.org> (raw)
In-Reply-To: <20191226221354.11957-1-sboyd@kernel.org>
Quoting Stephen Boyd (2019-12-26 14:13:54)
> If we don't warn here users of the CLK_IS_CRITICAL flag may not know
> that their clk isn't actually enabled because it silently fails to
> enable. Let's drop a big WARN_ON in that case so developers find these
> problems faster.
>
> Suggested-by: Jerome Brunet <jbrunet@baylibre.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
> ---
>
> I suspect that this may start warning for other users. Let's see
> and revert in case it doesn't work.
>
> drivers/clk/clk.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 772258de2d1f..6a9a66dfdeaa 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -3427,13 +3427,13 @@ static int __clk_core_init(struct clk_core *core)
> unsigned long flags;
>
> ret = clk_core_prepare(core);
> - if (ret)
> + if (WARN_ON(ret))
We should probably just print the clk name that failed to be critically
enabled with a pr_warn(). The traceback pointing to this location will
be really hard to understand otherwise.
> goto out;
>
> flags = clk_enable_lock();
> ret = clk_core_enable(core);
> clk_enable_unlock(flags);
> - if (ret) {
> + if (WARN_ON(ret)) {
> clk_core_unprepare(core);
> goto out;
> }
>
> base-commit: 12ead77432f2ce32dea797742316d15c5800cb32
> --
> Sent by a computer, using git, on the internet
>
next prev parent reply other threads:[~2019-12-30 17:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-26 22:13 [PATCH] clk: Warn about critical clks that fail to enable Stephen Boyd
2019-12-28 15:40 ` Markus Elfring
2019-12-30 17:55 ` Stephen Boyd [this message]
2019-12-30 18:46 ` Guenter Roeck
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=20191230175517.D2CC620718@mail.kernel.org \
--to=sboyd@kernel.org \
--cc=jbrunet@baylibre.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--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.