drm/amd: Fail the suspend sequence if GPU is not going to s0i3 or s3
Subsystems (2)
PATCH 1/1 drm/amd: Fail the suspend sequence if GPU is not going to s0i3 or s3
Before commit ca47518663973 ("drm/amd: Don't allow s0ix on APUs older than Raven") there were combinations allowed where a user could attempt to put a device into s2idle even if the platform was misconfigured.
The idea was just skip the whole amdgpu suspend and resume sequence. This however doesn't work properly for dGPUs. This is commonly triggered by a behavior in systemd that it will first try "deep" followed by "s2idle" if "deep" fails for any reason.
In this fail the suspend so that the system doesn't get put into a bad state.
Signed-off-by Mario Limonciello <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -2
@@ -2506,8 +2506,10 @@ static int amdgpu_pmops_suspend(struct device *dev) adev->in_s0ix = true; else if (amdgpu_acpi_is_s3_active(adev)) adev->in_s3 = true; -if (!adev->in_s0ix && !adev->in_s3) -return 0 ; +if (!adev->in_s0ix && !adev->in_s3) { +drm_warn_once (drm_dev,"Unsupported suspend state for device" ); +return -EINVAL ; + }return amdgpu_device_suspend (drm_dev, true); }
Signature · 1 line
2.34.1