]> Git Repo - linux.git/commitdiff
cpuidle: riscv-sbi: Add cpuidle_disabled() check
authorNick Hu <[email protected]>
Wed, 14 Aug 2024 05:44:34 +0000 (13:44 +0800)
committerPalmer Dabbelt <[email protected]>
Thu, 17 Oct 2024 18:34:43 +0000 (11:34 -0700)
The consumer devices that inside the cpu/cluster power domain may register
the genpd notifier where their power domains point to the pd nodes under
'/cpus/power-domains'. If the cpuidle.off==1, the genpd notifier will fail
due to sbi_cpuidle_pd_allow_domain_state is not set. We also need the
sbi_cpuidle_cpuhp_up/down to invoke the callbacks. Therefore adding a
cpuidle_disabled() check before cpuidle_register() to address the issue.

Signed-off-by: Nick Hu <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Palmer Dabbelt <[email protected]>
drivers/cpuidle/cpuidle-riscv-sbi.c

index 98e7751dbfe8a37bcfd8d1960a4f85b9c2b963c8..3c8a509288f3ae79a82d40f7528db4acd6eaca47 100644 (file)
@@ -25,6 +25,7 @@
 #include <asm/smp.h>
 #include <asm/suspend.h>
 
+#include "cpuidle.h"
 #include "dt_idle_states.h"
 #include "dt_idle_genpd.h"
 
@@ -336,6 +337,9 @@ static int sbi_cpuidle_init_cpu(struct device *dev, int cpu)
                return ret;
        }
 
+       if (cpuidle_disabled())
+               return 0;
+
        ret = cpuidle_register(drv, NULL);
        if (ret)
                goto deinit;
@@ -548,7 +552,10 @@ static int sbi_cpuidle_probe(struct platform_device *pdev)
        /* Setup CPU hotplut notifiers */
        sbi_idle_init_cpuhp();
 
-       pr_info("idle driver registered for all CPUs\n");
+       if (cpuidle_disabled())
+               pr_info("cpuidle is disabled\n");
+       else
+               pr_info("idle driver registered for all CPUs\n");
 
        return 0;
 
This page took 0.062343 seconds and 4 git commands to generate.