Skip to content

Commit 3ea4415

Browse files
leitaoctmarinas
authored andcommitted
ACPI: arm64: cpuidle: Tolerate platforms with no deep PSCI idle states
Commit cac173b ("ACPI: processor: idle: Rework the handling of acpi_processor_ffh_lpi_probe()") moved the acpi_processor_ffh_lpi_probe() call from acpi_processor_setup_cpuidle_dev(), where its return value was ignored, to acpi_processor_get_power_info(), where it is now treated as a hard failure. As a result, platforms where psci_acpi_cpu_init_idle() returned -ENODEV stopped registering any cpuidle states, forcing CPUs to busy-poll when idle. On NVIDIA Grace (aarch64) systems with PSCIv1.1, pr->power.count is 1 (only WFI, no deep PSCI states beyond it), so the previous "count = pr->power.count - 1; if (count <= 0) return -ENODEV;" check returned -ENODEV for all 72 CPUs and disabled cpuidle entirely. The lpi_states count is already validated in acpi_processor_get_lpi_info(), so the check here is redundant. Simplify the loop to iterate over lpi_states[1..power.count). When only WFI is present, the loop body simply does not execute and the function returns 0, which is the correct outcome: there is nothing to validate for FFH and no error to report. Suggested-by: Huisong Li <lihuisong@huawei.com> Cc: stable@vger.kernel.org Fixes: cac173b ("ACPI: processor: idle: Rework the handling of acpi_processor_ffh_lpi_probe()") Signed-off-by: Breno Leitao <leitao@debian.org> Reviewed-by: Sudeep Holla <sudeep.holla@kernel.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent caecde1 commit 3ea4415

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

drivers/acpi/arm64/cpuidle.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
static int psci_acpi_cpu_init_idle(unsigned int cpu)
1818
{
19-
int i, count;
19+
int i;
2020
struct acpi_lpi_state *lpi;
2121
struct acpi_processor *pr = per_cpu(processors, cpu);
2222

@@ -30,14 +30,10 @@ static int psci_acpi_cpu_init_idle(unsigned int cpu)
3030
if (!psci_ops.cpu_suspend)
3131
return -EOPNOTSUPP;
3232

33-
count = pr->power.count - 1;
34-
if (count <= 0)
35-
return -ENODEV;
36-
37-
for (i = 0; i < count; i++) {
33+
for (i = 1; i < pr->power.count; i++) {
3834
u32 state;
3935

40-
lpi = &pr->power.lpi_states[i + 1];
36+
lpi = &pr->power.lpi_states[i];
4137
/*
4238
* Only bits[31:0] represent a PSCI power_state while
4339
* bits[63:32] must be 0x0 as per ARM ACPI FFH Specification

0 commit comments

Comments
 (0)