Unverified Commit 77270206 authored by Palmer Dabbelt's avatar Palmer Dabbelt
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: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parents 5fb0ecf7 27b4d6aa
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -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,6 +542,9 @@ static int sbi_cpuidle_probe(struct platform_device *pdev)
	/* Setup CPU hotplut notifiers */
	sbi_idle_init_cpuhp();

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