linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Stephen Boyd <sboyd@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>
Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
	Jerome Brunet <jbrunet@baylibre.com>
Subject: Re: [PATCH v2] clk: Warn about critical clks that fail to enable
Date: Thu, 2 Jan 2020 06:17:37 -0800	[thread overview]
Message-ID: <6d4e8c19-6cb8-b242-3efb-0854ee2a107f@roeck-us.net> (raw)
In-Reply-To: <20200102005503.71923-1-sboyd@kernel.org>

On 1/1/20 4:55 PM, Stephen Boyd wrote:
> 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 print a warning 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>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
> 
> Changes from v1:
>   * Switched to pr_warn and indicated clk name
> 
>   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 772258de2d1f..b03c2be4014b 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -3427,13 +3427,18 @@ static int __clk_core_init(struct clk_core *core)
>   		unsigned long flags;
>   
>   		ret = clk_core_prepare(core);
> -		if (ret)
> +		if (ret) {
> +			pr_warn("%s: critical clk '%s' failed to prepare\n",
> +			       __func__, core->name);
>   			goto out;
> +		}
>   
>   		flags = clk_enable_lock();
>   		ret = clk_core_enable(core);
>   		clk_enable_unlock(flags);
>   		if (ret) {
> +			pr_warn("%s: critical clk '%s' failed to enable\n",
> +			       __func__, core->name);
>   			clk_core_unprepare(core);
>   			goto out;
>   		}
> 
> base-commit: 12ead77432f2ce32dea797742316d15c5800cb32
> 


  parent reply	other threads:[~2020-01-02 14:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-02  0:55 [PATCH v2] clk: Warn about critical clks that fail to enable Stephen Boyd
2020-01-02 12:47 ` Jerome Brunet
2020-01-02 14:17 ` Guenter Roeck [this message]
2020-01-05  7:22 ` 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=6d4e8c19-6cb8-b242-3efb-0854ee2a107f@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=jbrunet@baylibre.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.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 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).