summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@rivosinc.com>2024-10-17 21:34:46 +0300
committerPalmer Dabbelt <palmer@rivosinc.com>2024-10-17 21:34:46 +0300
commit77270206955db780690dddb32d1a74c587be55ea (patch)
tree23cf7c198b334814f1ad13ea478c6dc974bf96fc
parent5fb0ecf73e7ad59e7b3e4cd47a3d1a67eaa200af (diff)
parent27b4d6aa29abe6c4f0b7695bc831fcc8d32267d9 (diff)
downloadlinux-77270206955db780690dddb32d1a74c587be55ea.tar.xz
Merge patch series "cpuidle: riscv-sbi: Allow cpuidle pd used by other devices"
Nick Hu <nick.hu@sifive.com> says: Add this patchset so the devices that inside the cpu/cluster power domain can use the cpuidle pd to register the genpd notifier to handle the PM when cpu/cluster is going to enter a deeper sleep state. * b4-shazam-merge: cpuidle: riscv-sbi: Add cpuidle_disabled() check cpuidle: riscv-sbi: Move sbi_cpuidle_init to arch_initcall Link: https://lore.kernel.org/r/20240814054434.3563453-1-nick.hu@sifive.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
-rw-r--r--drivers/cpuidle/cpuidle-riscv-sbi.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/cpuidle/cpuidle-riscv-sbi.c b/drivers/cpuidle/cpuidle-riscv-sbi.c
index d228b4d18d56..14462c092039 100644
--- a/drivers/cpuidle/cpuidle-riscv-sbi.c
+++ b/drivers/cpuidle/cpuidle-riscv-sbi.c
@@ -26,6 +26,7 @@
#include <asm/smp.h>
#include <asm/suspend.h>
+#include "cpuidle.h"
#include "dt_idle_states.h"
#include "dt_idle_genpd.h"
@@ -329,6 +330,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;
@@ -538,7 +542,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;
@@ -582,4 +589,4 @@ static int __init sbi_cpuidle_init(void)
return 0;
}
-device_initcall(sbi_cpuidle_init);
+arch_initcall(sbi_cpuidle_init);