From: Stephen Boyd Date: Thu, 26 Dec 2019 22:09:27 +0000 (-0800) Subject: clk: Warn about critical clks that fail to enable X-Git-Tag: v5.15~4521^2~19^3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2d2699926143624ef0fce3bbb5a0f089d674d12c;p=platform%2Fkernel%2Flinux-starfive.git clk: Warn about critical clks that fail to enable 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 Cc: Guenter Roeck Signed-off-by: Stephen Boyd Link: https://lkml.kernel.org/r/20200102005503.71923-1-sboyd@kernel.org Reviewed-by: Jerome Brunet Reviewed-by: Guenter Roeck --- diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 772258d..b03c2be 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; }