clk: Warn about critical clks that fail to enable
Stephen Boyd
maintainerPATCH 1/1 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 drop a big WARN_ON in that case so developers find these problems faster.
---
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(-)
drivers/clk/clk.c +2 -2
@@ -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)) 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
Signature · 1 line
Sent by a computer, using git, on the internet
Quoted 4 lines
If we don't warn here users of the
CLK_IS_CRITICALflag may not know that their clk isn't actually enabled because it silently fails to enable. Let's drop a bigWARN_ONin that case so developers find these problems faster.
Would you like to avoid an extra warning for failures with non-critical clocks?
Quoted 1 line
I suspect that this may start warning for other users.
Will this software development concern trigger any further collateral evolution?
Regards,
Markus
Stephen Boyd
maintainerQuoting Stephen Boyd (2019-12-26 14:13:54)
Quoted 21 lines
If we don't warn here users of the
CLK_IS_CRITICALflag may not know that their clk isn't actually enabled because it silently fails to enable. Let's drop a bigWARN_ONin that case so developers find these problems faster.Suggested-by Jerome Brunet <[email protected]>Cc Guenter Roeck <[email protected]>Signed-off-by Stephen Boyd <[email protected]>---
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(-)drivers/clk/clk.c +0
-0
drivers/clk/clk.c static int __clk_core_init(struct clk_core *core) · line 3430
Quoted 5 lines
drivers/clk/clk.c +1
-1@@ -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.
Quoted 15 lines
drivers/clk/clk.c +1
-1goto 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:
12ead77432f2ce32dea797742316d15c5800cb32Signature · 1 line
Sent by a computer, using git, on the internet
Quoted 24 lines · Stephen Boyd
Quoting Stephen Boyd (2019-12-26 14:13:54)
Quoted 23 lines
If we don't warn here users of the
CLK_IS_CRITICALflag may not know that their clk isn't actually enabled because it silently fails to enable. Let's drop a bigWARN_ONin that case so developers find these problems faster.Suggested-by Jerome Brunet <[email protected]>Cc Guenter Roeck <[email protected]>Signed-off-by Stephen Boyd <[email protected]>---
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(-)drivers/clk/clk.c +0
-0@@ -3427,13 +3427,13 @@ static int __clk_core_init(struct clk_core *core)unsigned long flags;
Quoted 8 lines
drivers/clk/clk.c static int __clk_core_init(struct clk_core *core) · line 3430
Quoted 3 lines
drivers/clk/clk.c +1
-1ret =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.
Agreed.
Guenter
Quoted 15 lines
Quoted 15 lines
drivers/clk/clk.c +1
-1goto 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:
12ead77432f2ce32dea797742316d15c5800cb32Signature · 1 line
Sent by a computer, using git, on the internet