Skip to contentSkip to conversation

ACPI: PM: x86: Print messages regarding LPS0 idle support

PATCH In review Rafael J. Wysocki 2 participants 2 messages Jul 21, 2022 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: PM: x86: Print messages regarding LPS0 idle support

From: Rafael J. Wysocki <[email protected]>

Because suspend-to-idle is always supported and on x86 it is the only way to suspend the system if S3 is not supported by the platform, the kernel attempts to enter low-power S0 idle in the suspend-to-idle flow regardless of whether or not the ACPI_FADT_LOW_POWER_S0 flag is set in the FADT. However, if that flag is not set, residency counters associated with low-power S0 idle may not count and the platform may refuse to put the EC into a low-power mode, for example.

For this reason, print diagnostic messages when the platform should achieve significant energy savings in low-power S0 idle (because the ACPI_FADT_LOW_POWER_S0 flag is set in the FADT) and when suspend-to-idle becomes the default suspend method (because low-power S0 idle should be equally or more efficient than S3, if available).

---
 drivers/acpi/sleep.c      |    3 +++
 drivers/acpi/x86/s2idle.c |    4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/acpi/sleep.c +3 -0
Index: linux-pm/drivers/acpi/sleep.c
===================================================================
@@ -824,6 +824,9 @@ static const struct platform_s2idle_ops
 
 void __weak acpi_s2idle_setup(void)
 {
+	if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)
+		pr_info("Efficient low-power S0 idle declared\n");
+
 	s2idle_set_ops(&acpi_s2idle_ops);
 }
 
drivers/acpi/x86/s2idle.c +3 -1
Index: linux-pm/drivers/acpi/x86/s2idle.c
===================================================================
@@ -423,8 +423,10 @@ static int lps0_device_attach(struct acp
 	 * line.
 	 */
 	if ((acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) &&
-	    mem_sleep_default > PM_SUSPEND_MEM && !acpi_sleep_default_s3)
+	    mem_sleep_default > PM_SUSPEND_MEM && !acpi_sleep_default_s3) {
 		mem_sleep_current = PM_SUSPEND_TO_IDLE;
+		pr_info("Low-power S0 idle used by default for system suspend\n");
+	}
 
 	/*
 	 * Some LPS0 systems, like ASUS Zenbook UX430UNR/i7-8550U, require the
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

Because suspend-to-idle is always supported and on x86 it is the only way to suspend the system if S3 is not supported by the platform, the kernel attempts to enter low-power S0 idle in the suspend-to-idle flow regardless of whether or not the ACPI_FADT_LOW_POWER_S0 flag is set in the FADT. However, if that flag is not set, residency counters associated with low-power S0 idle may not count and the platform may refuse to put the EC into a low-power mode, for example.

Quoted 7 lines

For this reason, print diagnostic messages when the platform should achieve significant energy savings in low-power S0 idle (because the ACPI_FADT_LOW_POWER_S0 flag is set in the FADT) and when suspend-to-idle becomes the default suspend method (because low-power S0 idle should be equally or more efficient than S3, if available).

Quoted 38 lines
---
  drivers/acpi/sleep.c      |    3 +++
  drivers/acpi/x86/s2idle.c |    4 +++-
  2 files changed, 6 insertions(+), 1 deletion(-)

Index: linux-pm/drivers/acpi/sleep.c
===================================================================

drivers/acpi/sleep.c +3 -0
@@ -824,6 +824,9 @@ static const struct platform_s2idle_ops
 
  void __weak acpi_s2idle_setup(void)
  {
+	if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)
+		pr_info("Efficient low-power S0 idle declared\n");
+
  	s2idle_set_ops(&acpi_s2idle_ops);
  }
 

Index: linux-pm/drivers/acpi/x86/s2idle.c
===================================================================

drivers/acpi/x86/s2idle.c +3 -1
@@ -423,8 +423,10 @@ static int lps0_device_attach(struct acp
  	 * line.
  	 */
  	if ((acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) &&
-	    mem_sleep_default > PM_SUSPEND_MEM && !acpi_sleep_default_s3)
+	    mem_sleep_default > PM_SUSPEND_MEM && !acpi_sleep_default_s3) {
  		mem_sleep_current = PM_SUSPEND_TO_IDLE;
+		pr_info("Low-power S0 idle used by default for system suspend\n");
+	}
 
  	/*
  	 * Some LPS0 systems, like ASUS Zenbook UX430UNR/i7-8550U, require the