Skip to content

Commit 8cbbd11

Browse files
jiadozhualexdeucher
authored andcommitted
drm/amdgpu: set completion status as preempted for the resubmission
The driver's CSA buffer is shared by all the ibs. When the high priority ib is submitted after the preempted ib, CP overrides the ib_completion_status as completed in the csa buffer. After that the preempted ib is resubmitted, CP would clear some locals stored for ib resume when reading the completed status, which causes gpu hang in some cases. Always set status as preempted for those resubmitted ib instead of reading everything from the CSA buffer. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2535 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2717 Signed-off-by: Jiadong Zhu <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent db996e6 commit 8cbbd11

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ enum amdgpu_ring_mux_offset_type {
5656
AMDGPU_MUX_OFFSET_TYPE_CE,
5757
};
5858

59+
enum ib_complete_status {
60+
/* IB not started/reset value, default value. */
61+
IB_COMPLETION_STATUS_DEFAULT = 0,
62+
/* IB preempted, started but not completed. */
63+
IB_COMPLETION_STATUS_PREEMPTED = 1,
64+
/* IB completed. */
65+
IB_COMPLETION_STATUS_COMPLETED = 2,
66+
};
67+
5968
struct amdgpu_ring_mux {
6069
struct amdgpu_ring *real_ring;
6170

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5226,6 +5226,9 @@ static void gfx_v9_0_ring_patch_de_meta(struct amdgpu_ring *ring,
52265226
de_payload_cpu_addr = adev->virt.csa_cpu_addr + payload_offset;
52275227
}
52285228

5229+
((struct v9_de_ib_state *)de_payload_cpu_addr)->ib_completion_status =
5230+
IB_COMPLETION_STATUS_PREEMPTED;
5231+
52295232
if (offset + (payload_size >> 2) <= ring->buf_mask + 1) {
52305233
memcpy((void *)&ring->ring[offset], de_payload_cpu_addr, payload_size);
52315234
} else {

0 commit comments

Comments
 (0)