drm/amdgpu: Improve SDMA reset logic with guilty queue tracking
authorJesse.zhang@amd.com <Jesse.zhang@amd.com>
Thu, 20 Feb 2025 06:43:59 +0000 (14:43 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Feb 2025 16:43:59 +0000 (11:43 -0500)
commitfdbfaaaae06bbf3074d309b03d3853281f6cf433
treeb12ecbba80831a6ed3f9e5fcfbe96c1728540685
parent0ad649321ae2537191f6cfa15ace5cc48d15f0bc
drm/amdgpu: Improve SDMA reset logic with guilty queue tracking

This patch includes the remaining improvements to the SDMA reset logic:
- Added `gfx_guilty` and `page_guilty` flags to track guilty queues.
- Updated the reset and resume functions to handle the guilty state.
- Cached the `rptr` before reset.

v2:
   1.replace the caller with a guilty bool.
   If the queue is the guilty one, set the rptr and wptr  to the saved wptr value,
   else, set the rptr and wptr to the saved rptr value. (Alex)
   2. cache the rptr before the reset. (Alex)

v3: Keeping intermediate variables like u64 rwptr simplifies resotre rptr/wptr.(Lijo)

Suggested-by: Alex Deucher <alexander.deucher@amd.com>
Suggested-by: Jiadong Zhu <Jiadong.Zhu@amd.com>
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c