Skip to contentSkip to conversation

drm: amd: amdgpu: ACPI: Add comment about ACPI_FADT_LOW_POWER_S0

PATCH Applied Rafael J. Wysocki 3 participants 3 messages Aug 24, 2022 – Aug 25, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: amd: amdgpu: ACPI: Add comment about ACPI_FADT_LOW_POWER_S0

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

According to the ACPI specification [1], the ACPI_FADT_LOW_POWER_S0 flag merely means that it is better to use low-power S0 idle on the given platform than S3 (provided that the latter is supported) and it doesn't preclude using either of them (which of them will be used depends on the choices made by user space).

However, on some systems that flag is used to indicate whether or not to enable special firmware mechanics allowing the system to save more energy when suspended to idle. If that flag is unset, doing so is generally risky.

Accordingly, add a comment to explain the ACPI_FADT_LOW_POWER_S0 check in amdgpu_acpi_is_s0ix_active(), the purpose of which is otherwise somewhat unclear.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +6 -0
Index: linux-pm/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
===================================================================
@@ -1066,6 +1066,12 @@ bool amdgpu_acpi_is_s0ix_active(struct a
 	    (pm_suspend_target_state != PM_SUSPEND_TO_IDLE))
 		return false;
 
+	/*
+	 * If ACPI_FADT_LOW_POWER_S0 is not set in the FADT, it is generally
+	 * risky to do any special firmware-related preparations for entering
+	 * S0ix even though the system is suspending to idle, so return false
+	 * in that case.
+	 */
 	if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) {
 		dev_warn_once(adev->dev,
 			      "Power consumption will be higher as BIOS has not been configured for suspend-to-idle.\n"
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Rafael J. Wysocki

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

According to the ACPI specification [1], the ACPI_FADT_LOW_POWER_S0 flag merely means that it is better to use low-power S0 idle on the given platform than S3 (provided that the latter is supported) and it doesn't preclude using either of them (which of them will be used depends on the choices made by user space).

However, on some systems that flag is used to indicate whether or not to enable special firmware mechanics allowing the system to save more energy when suspended to idle. If that flag is unset, doing so is generally risky.

Quoted 6 lines

Accordingly, add a comment to explain the ACPI_FADT_LOW_POWER_S0 check in amdgpu_acpi_is_s0ix_active(), the purpose of which is otherwise somewhat unclear.

Quoted 24 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c |    6 ++++++
  1 file changed, 6 insertions(+)

Index: linux-pm/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
===================================================================

drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +6 -0
@@ -1066,6 +1066,12 @@ bool amdgpu_acpi_is_s0ix_active(struct a
  	    (pm_suspend_target_state != PM_SUSPEND_TO_IDLE))
  		return false;
 
+	/*
+	 * If ACPI_FADT_LOW_POWER_S0 is not set in the FADT, it is generally
+	 * risky to do any special firmware-related preparations for entering
+	 * S0ix even though the system is suspending to idle, so return false
+	 * in that case.
+	 */
  	if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) {
  		dev_warn_once(adev->dev,
  			      "Power consumption will be higher as BIOS has not been configured for suspend-to-idle.\n"
Applied
#2 lore raw

Applied. Thanks!

Alex

Quoted 49 lines · Mario
Quoted 13 lines · Rafael J. Wysocki

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

According to the ACPI specification [1], the ACPI_FADT_LOW_POWER_S0 flag merely means that it is better to use low-power S0 idle on the given platform than S3 (provided that the latter is supported) and it doesn't preclude using either of them (which of them will be used depends on the choices made by user space).

However, on some systems that flag is used to indicate whether or not to enable special firmware mechanics allowing the system to save more energy when suspended to idle. If that flag is unset, doing so is generally risky.

Quoted 6 lines

Accordingly, add a comment to explain the ACPI_FADT_LOW_POWER_S0 check in amdgpu_acpi_is_s0ix_active(), the purpose of which is otherwise somewhat unclear.

Quoted 24 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c |    6 ++++++
  1 file changed, 6 insertions(+)

Index: linux-pm/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
===================================================================

drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +6 -0
@@ -1066,6 +1066,12 @@ bool amdgpu_acpi_is_s0ix_active(struct a
          (pm_suspend_target_state != PM_SUSPEND_TO_IDLE))
              return false;
 
+     /*
+      * If ACPI_FADT_LOW_POWER_S0 is not set in the FADT, it is generally
+      * risky to do any special firmware-related preparations for entering
+      * S0ix even though the system is suspending to idle, so return false
+      * in that case.
+      */
      if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) {
              dev_warn_once(adev->dev,
                            "Power consumption will be higher as BIOS has not been configured for suspend-to-idle.\n"