ACPI / processor: Set default C1 idle state description
authorYazen Ghannam <yazen.ghannam@amd.com>
Mon, 29 Jan 2018 20:22:49 +0000 (14:22 -0600)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 4 Feb 2018 08:21:44 +0000 (09:21 +0100)
The ACPI idle driver will default to ACPI_CSTATE_HALT for C1 if a _CST
object for C1 is not defined. However, the description will not be set,
so users will see "<null>" when reading the description from sysfs.

Set the C1 state description when defaulting to ACPI_CSTATE_HALT.

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/processor_idle.c

index d50a7b6..226dc56 100644 (file)
@@ -291,6 +291,9 @@ static int acpi_processor_get_power_info_default(struct acpi_processor *pr)
                pr->power.states[ACPI_STATE_C1].type = ACPI_STATE_C1;
                pr->power.states[ACPI_STATE_C1].valid = 1;
                pr->power.states[ACPI_STATE_C1].entry_method = ACPI_CSTATE_HALT;
+
+               snprintf(pr->power.states[ACPI_STATE_C1].desc,
+                        ACPI_CX_DESC_LEN, "ACPI HLT");
        }
        /* the C0 state only exists as a filler in our array */
        pr->power.states[ACPI_STATE_C0].valid = 1;