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>
This commit is contained in:
Palmer Dabbelt
2024-10-17 11:34:46 -07:00

View File

@@ -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);