mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02:00
cpuidle: PSCI: Move the has_lpi check to the beginning of the function
commit 01f6c7338c upstream.
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.
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cfa98ffc42
commit
503934df31
|
|
@ -54,6 +54,9 @@ static int psci_acpi_cpu_init_idle(unsigned int cpu)
|
||||||
struct acpi_lpi_state *lpi;
|
struct acpi_lpi_state *lpi;
|
||||||
struct acpi_processor *pr = per_cpu(processors, cpu);
|
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
|
* If the PSCI cpu_suspend function hook has not been initialized
|
||||||
* idle states must not be enabled, so bail out
|
* 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)
|
if (!psci_ops.cpu_suspend)
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
if (unlikely(!pr || !pr->flags.has_lpi))
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
count = pr->power.count - 1;
|
count = pr->power.count - 1;
|
||||||
if (count <= 0)
|
if (count <= 0)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user