Skip to contentSkip to conversation

ACPI / processor_idle: Set default C1 state description

PATCH Applied Yazen Ghannam 2 participants 2 messages Jan 29, 2018 – Feb 8, 2018 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI / processor_idle: Set default C1 state description

From: Yazen Ghannam <[email protected]>

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.

---
 drivers/acpi/processor_idle.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/acpi/processor_idle.c +3 -0
index 5f0071c7e2e1..abb559cd28d7 100644
@@ -292,6 +292,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;
Signature · 1 line
2.14.1
#1 lore raw
Quoted 20 lines · CET Yazen Ghannam

From: Yazen Ghannam <[email protected]>

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.

---
 drivers/acpi/processor_idle.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/acpi/processor_idle.c +0 -0
index 5f0071c7e2e1..abb559cd28d7 100644

drivers/acpi/processor_idle.c static int acpi_processor_get_power_info_default(struct acpi_processor *pr) · line 300

Quoted 9 lines
drivers/acpi/processor_idle.c +3 -0
@@ -292,6 +292,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;

Applied, thanks!