Message ID | 20220225031255.3647599-2-mario.limonciello@amd.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
Series | Avoid enabling LPI on non-ARM | expand |
On Thu, Feb 24, 2022 at 09:12:54PM -0600, Mario Limonciello wrote: > Currently the first thing checked is whether the PCSI cpu_suspend function > has been initialized. > > Another change will be overloading `acpi_processor_ffh_lpi_probe` and > calling it sooner. So make the `has_lpi` check the first thing checked > to prepare for that change. > You need to cc arm64 maintainers and get their ack to merge this via ACPI tree. Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
diff --git a/arch/arm64/kernel/cpuidle.c b/arch/arm64/kernel/cpuidle.c index 03991eeff643..3006f4324808 100644 --- a/arch/arm64/kernel/cpuidle.c +++ b/arch/arm64/kernel/cpuidle.c @@ -54,6 +54,9 @@ static int psci_acpi_cpu_init_idle(unsigned int cpu) struct acpi_lpi_state *lpi; struct acpi_processor *pr = per_cpu(processors, cpu); + if (unlikely(!pr || !pr->flags.has_lpi)) + return -EINVAL; + /* * If the PSCI cpu_suspend function hook has not been initialized * idle states must not be enabled, so bail out @@ -61,9 +64,6 @@ static int psci_acpi_cpu_init_idle(unsigned int cpu) if (!psci_ops.cpu_suspend) return -EOPNOTSUPP; - if (unlikely(!pr || !pr->flags.has_lpi)) - return -EINVAL; - count = pr->power.count - 1; if (count <= 0) return -ENODEV;
Currently the first thing checked is whether the PCSI cpu_suspend function has been initialized. Another change will be overloading `acpi_processor_ffh_lpi_probe` and calling it sooner. So make the `has_lpi` check the first thing checked to prepare for that change. Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> --- arch/arm64/kernel/cpuidle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)