Skip to contentSkip to conversation

ACPI / processor: Set P_LVL{2,3} idle state descriptions

PATCH Applied Ghannam, Yazen 2 participants 2 messages Feb 18, 2019 – Feb 19, 2019 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI / processor: Set P_LVL{2,3} idle state descriptions

From: Yazen Ghannam <[email protected]>

The ACPI idle driver will fallback to using the legacy P_LVL* SystemIO method of entering C-states if the _CST method is disabled and P_BLK is defined. However, in this case the C2 and C3 states won't have a description set, so the user will see "<null>" when reading the description from sysfs.

Give each of these states a description.

---
 drivers/acpi/processor_idle.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/acpi/processor_idle.c +7 -0
index b2131c4ea124..98d4ec5bf450 100644
@@ -282,6 +282,13 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
 			  pr->power.states[ACPI_STATE_C2].address,
 			  pr->power.states[ACPI_STATE_C3].address));
 
+	snprintf(pr->power.states[ACPI_STATE_C2].desc,
+			 ACPI_CX_DESC_LEN, "ACPI P_LVL2 IOPORT 0x%x",
+			 pr->power.states[ACPI_STATE_C2].address);
+	snprintf(pr->power.states[ACPI_STATE_C3].desc,
+			 ACPI_CX_DESC_LEN, "ACPI P_LVL3 IOPORT 0x%x",
+			 pr->power.states[ACPI_STATE_C3].address);
+
 	return 0;
 }
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 24 lines · Yazen

From: Yazen Ghannam <[email protected]>

The ACPI idle driver will fallback to using the legacy P_LVL* SystemIO method of entering C-states if the _CST method is disabled and P_BLK is defined. However, in this case the C2 and C3 states won't have a description set, so the user will see "<null>" when reading the description from sysfs.

Give each of these states a description.

---
 drivers/acpi/processor_idle.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/acpi/processor_idle.c +0 -0
index b2131c4ea124..98d4ec5bf450 100644
@@ -282,6 +282,13 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
 			  pr->power.states[ACPI_STATE_C2].address,
 			  pr->power.states[ACPI_STATE_C3].address));
 

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

Quoted 10 lines
drivers/acpi/processor_idle.c +7 -0
+	snprintf(pr->power.states[ACPI_STATE_C2].desc,
+			 ACPI_CX_DESC_LEN, "ACPI P_LVL2 IOPORT 0x%x",
+			 pr->power.states[ACPI_STATE_C2].address);
+	snprintf(pr->power.states[ACPI_STATE_C3].desc,
+			 ACPI_CX_DESC_LEN, "ACPI P_LVL3 IOPORT 0x%x",
+			 pr->power.states[ACPI_STATE_C3].address);
+
 	return 0;
 }
 

Applied, thanks!