When cpuidle drivers do not supply explicit power_usage values, cpuidle/driver.c inserts dummy values instead. When a running processor dynamically gains new C-states (e.g. after ACPI events), the power_usage values of those states will stay uninitialized, and cpuidle governors will never choose to enter them.
This patch ensures that the ACPI cpuidle driver sets those dummy power values itself whenever it (re-)initializes its idle states. Tested and verified on an Acer AC700 Chromebook, which supports the C3 state only when it switches from AC to battery power.
Signed-off-by: Julius Werner jwerner@chromium.org --- drivers/acpi/processor_idle.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index e8086c7..078e22f 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1090,6 +1090,9 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr) state->exit_latency = cx->latency; state->target_residency = cx->latency * latency_factor;
+ /* reinitialize this in case new states are added after boot */ + state->power_usage = -1 - count; + state->flags = 0; switch (cx->type) { case ACPI_STATE_C1: