Skip to content

Commit 496121c

Browse files
zhang-ruirafaeljw
authored andcommitted
ACPI: processor: idle: Allow probing on platforms with one ACPI C-state
It is possible for ACPI _CST to return only one ACPI C-state, for example, when deep cstate disabled in the BIOS. And it is better for the acpi_idle driver to probe succesfully in this case as well for consistency. Signed-off-by: Zhang Rui <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 6a8b55e commit 496121c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

drivers/acpi/processor_idle.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
308308
if (ret)
309309
return ret;
310310

311-
/*
312-
* It is expected that there will be at least 2 states, C1 and
313-
* something else (C2 or C3), so fail if that is not the case.
314-
*/
315-
if (pr->power.count < 2)
311+
if (!pr->power.count)
316312
return -EFAULT;
317313

318314
pr->flags.has_cst = 1;
@@ -468,8 +464,7 @@ static int acpi_processor_get_cstate_info(struct acpi_processor *pr)
468464
for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
469465
if (pr->power.states[i].valid) {
470466
pr->power.count = i;
471-
if (pr->power.states[i].type >= ACPI_STATE_C2)
472-
pr->flags.power = 1;
467+
pr->flags.power = 1;
473468
}
474469
}
475470

0 commit comments

Comments
 (0)