From 973a50908bd635d49b7fcd58e377b77ed0b16bb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Tue, 8 Sep 2026 20:10:49 +0200 Subject: [PATCH] drm/amdgpu/sdma: Clear SDMA rings after reset before starting them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ring contains commands that were emitted before the reset. These need to be cleared to make sure the HW doesn't execute them, because they are garbage at this point. Note that the ring reset helpers will re-emit the commands that are necessary after the reset. Signed-off-by: Timur Kristóf Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c index fbac732f3e01..3495b7553950 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c @@ -593,6 +593,11 @@ int amdgpu_sdma_reset_engine(struct amdgpu_device *adev, uint32_t instance_id, goto exit; } + amdgpu_ring_clear_ring_and_ptrs(gfx_ring); + + if (adev->sdma.has_page_queue) + amdgpu_ring_clear_ring_and_ptrs(page_ring); + if (sdma_instance->funcs->start_kernel_queue) { sdma_instance->funcs->start_kernel_queue(gfx_ring); if (adev->sdma.has_page_queue)