[PATCH] clk: Print an info line before disabling unused clocks

Konrad Dybcio posted 1 patch 3 years, 1 month ago
There is a newer version of this series
drivers/clk/clk.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] clk: Print an info line before disabling unused clocks
Posted by Konrad Dybcio 3 years, 1 month ago
Currently, the regulator framework informs us before calling into
their unused cleanup paths, which eases at least some debugging. The
same could be beneficial for clocks, so that random shutdowns shortly
after most initcalls are done can be less of a guess.

Add a pr_info before disabling unused clocks to do so.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/clk/clk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index ae07685c7588..827a51fe6653 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1404,7 +1404,8 @@ static int __init clk_disable_unused(void)
 	if (clk_ignore_unused) {
 		pr_warn("clk: Not disabling unused clocks\n");
 		return 0;
-	}
+	} else
+		pr_info("clk: Disabling unused clocks\n");
 
 	clk_prepare_lock();
 
-- 
2.39.2
Re: [PATCH] clk: Print an info line before disabling unused clocks
Posted by Marijn Suijten 3 years, 1 month ago
On 2023-03-06 14:41:08, Konrad Dybcio wrote:
> Currently, the regulator framework informs us before calling into
> their unused cleanup paths, which eases at least some debugging. The
> same could be beneficial for clocks, so that random shutdowns shortly
> after most initcalls are done can be less of a guess.
> 
> Add a pr_info before disabling unused clocks to do so.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  drivers/clk/clk.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index ae07685c7588..827a51fe6653 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -1404,7 +1404,8 @@ static int __init clk_disable_unused(void)
>  	if (clk_ignore_unused) {
>  		pr_warn("clk: Not disabling unused clocks\n");
>  		return 0;
> -	}
> +	} else

You shouldn't need an else here, as the if body above returns.  That
also aligns this pr_info with the actual code that performs the clk
disablement.

With that fxed, thanks a lot for this useful info in dmesg! Feel free to
add my r-b.

- Marijn

> +		pr_info("clk: Disabling unused clocks\n");
>  
>  	clk_prepare_lock();
>  
> -- 
> 2.39.2
>