All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 1/4] drm/amd: Warn users about potential s0ix problems
@ 2022-01-26  4:09 Mario Limonciello
  2022-01-26  4:09 ` [PATCH v5 2/4] drm/amd: add support to check whether the system is set to s3 Mario Limonciello
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Mario Limonciello @ 2022-01-26  4:09 UTC (permalink / raw)
  To: amd-gfx; +Cc: Bjoren Dasse, prike.liang, Mario Limonciello

On some OEM setups users can configure the BIOS for S3 or S2idle.
When configured to S3 users can still choose 's2idle' in the kernel by
using `/sys/power/mem_sleep`.  Before commit 6dc8265f9803 ("drm/amdgpu:
always reset the asic in suspend (v2)"), the GPU would crash.  Now when
configured this way, the system should resume but will use more power.

As such, adjust the `amdpu_acpi_is_s0ix function` to warn users about
potential power consumption issues during their first attempt at
suspending.

Reported-by: Bjoren Dasse <bjoern.daase@gmail.com>
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1824
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
index 4811b0faafd9..2531da6cbec3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -1040,11 +1040,20 @@ void amdgpu_acpi_detect(void)
  */
 bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
 {
-#if IS_ENABLED(CONFIG_AMD_PMC) && IS_ENABLED(CONFIG_SUSPEND)
-	if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) {
-		if (adev->flags & AMD_IS_APU)
-			return pm_suspend_target_state == PM_SUSPEND_TO_IDLE;
-	}
-#endif
+#if IS_ENABLED(CONFIG_SUSPEND)
+	if (!(adev->flags & AMD_IS_APU) ||
+	    pm_suspend_target_state != PM_SUSPEND_TO_IDLE)
+		return false;
+#else
 	return false;
+#endif
+	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"
+			      "To use suspend-to-idle change the sleep mode in BIOS setup.\n");
+#if !IS_ENABLED(CONFIG_AMD_PMC)
+	dev_warn_once(adev->dev,
+		      "Power consumption will be higher as the kernel has not been compiled with CONFIG_AMD_PMC.\n");
+#endif
+	return true;
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-01-26 16:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26  4:09 [PATCH v5 1/4] drm/amd: Warn users about potential s0ix problems Mario Limonciello
2022-01-26  4:09 ` [PATCH v5 2/4] drm/amd: add support to check whether the system is set to s3 Mario Limonciello
2022-01-26 15:06   ` Lazar, Lijo
2022-01-26 15:07     ` Limonciello, Mario
2022-01-26 15:11       ` Lazar, Lijo
2022-01-26 15:17         ` Limonciello, Mario
2022-01-26 15:32           ` Lazar, Lijo
2022-01-26 15:40             ` Alex Deucher
2022-01-26 16:31               ` Limonciello, Mario
2022-01-26  4:09 ` [PATCH v5 3/4] drm/amd: Only run s3 or s0ix if system is configured properly Mario Limonciello
2022-01-26  4:09 ` [PATCH v5 4/4] drm/amd: don't reset dGPUs that don't go through system S3 Mario Limonciello
2022-01-26 14:57   ` Limonciello, Mario

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.