It's been observed that with DCN 3.1.4 s2idle entry will hang occasionally on s2idle entry, but only if running Wayland and only when using `systemctl suspend`, not `echo mem | tee /sys/power/state`. This happens because using `systemctl suspend` will cause the screen to lock right before writing mem into /sys/power/state. This causes a delayed GFXOFF entry to be scheduled right before s2idle entry. If the workqueue doesn't get processed before the RLC is turned off the system is hung. Even if the workqueue *does* get processed, there is a race between the APU microcontrollers and driver for whether GFX is actually powered off when RLC is turned off. To avoid this issue, flush the workqueue on s2idle entry and ensure that GFX is really in GFXOFF before any sensitive register accesses occur. Mario Limonciello (3): drm/amd: Flush any delayed gfxoff on suspend entry drm/amd: Poll for GFX core to be off drm/amd: Add safety check to make sure RLC is only turned off while in GFXOFF drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 21 +++++++++++++++++++-- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 22 ++++++++++++++++++++++ drivers/gpu/drm/amd/include/amd_shared.h | 1 + 3 files changed, 42 insertions(+), 2 deletions(-) -- 2.34.1