drm/amd: Warn users about potential s0ix problems
Subsystems (2)
PATCH v3 1/1 drm/amd: Warn users about potential s0ix problems
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.
---v2->v3:
* Better direct users how to recover in the bad casesv1->v2:
* Only show messages in s2idle cases
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +11 -6
@@ -1040,11 +1040,16 @@ 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 ; - } +if (!(adev->flags &AMD_IS_APU ) || + pm_suspend_target_state !=PM_SUSPEND_TO_IDLE ) +return false; +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 false; +return true; }
Signature · 1 line
2.25.1
[Public]
IS_ENABLED(CONFIG_SUSPEND) will be required for using pm_suspend_target_state.
Thanks,
Lijo