Skip to content

Commit 7727020

Browse files
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>
2 parents 5fb0ecf + 27b4d6a commit 7727020

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/cpuidle/cpuidle-riscv-sbi.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <asm/smp.h>
2727
#include <asm/suspend.h>
2828

29+
#include "cpuidle.h"
2930
#include "dt_idle_states.h"
3031
#include "dt_idle_genpd.h"
3132

@@ -329,6 +330,9 @@ static int sbi_cpuidle_init_cpu(struct device *dev, int cpu)
329330
return ret;
330331
}
331332

333+
if (cpuidle_disabled())
334+
return 0;
335+
332336
ret = cpuidle_register(drv, NULL);
333337
if (ret)
334338
goto deinit;
@@ -538,7 +542,10 @@ static int sbi_cpuidle_probe(struct platform_device *pdev)
538542
/* Setup CPU hotplut notifiers */
539543
sbi_idle_init_cpuhp();
540544

541-
pr_info("idle driver registered for all CPUs\n");
545+
if (cpuidle_disabled())
546+
pr_info("cpuidle is disabled\n");
547+
else
548+
pr_info("idle driver registered for all CPUs\n");
542549

543550
return 0;
544551

@@ -582,4 +589,4 @@ static int __init sbi_cpuidle_init(void)
582589

583590
return 0;
584591
}
585-
device_initcall(sbi_cpuidle_init);
592+
arch_initcall(sbi_cpuidle_init);

0 commit comments

Comments
 (0)