Skip to content

Commit 7469567

Browse files
Jie1zhangalexdeucher
authored andcommitted
drm/amdgpu: Add fallback to pipe reset if KCQ ring reset fails
Add a fallback mechanism to attempt pipe reset when KCQ reset fails to recover the ring. After performing the KCQ reset and queue remapping, test the ring functionality. If the ring test fails, initiate a pipe reset as an additional recovery step. v2: fix the typo (Lijo) v3: try pipeline reset when kiq mapping fails (Lijo) Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 4c709cc commit 7469567

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3560,6 +3560,7 @@ static int gfx_v9_4_3_reset_kcq(struct amdgpu_ring *ring,
35603560
struct amdgpu_device *adev = ring->adev;
35613561
struct amdgpu_kiq *kiq = &adev->gfx.kiq[ring->xcc_id];
35623562
struct amdgpu_ring *kiq_ring = &kiq->ring;
3563+
int reset_mode = AMDGPU_RESET_TYPE_PER_QUEUE;
35633564
unsigned long flags;
35643565
int r;
35653566

@@ -3597,6 +3598,7 @@ static int gfx_v9_4_3_reset_kcq(struct amdgpu_ring *ring,
35973598
if (!(adev->gfx.compute_supported_reset & AMDGPU_RESET_TYPE_PER_PIPE))
35983599
return -EOPNOTSUPP;
35993600
r = gfx_v9_4_3_reset_hw_pipe(ring);
3601+
reset_mode = AMDGPU_RESET_TYPE_PER_PIPE;
36003602
dev_info(adev->dev, "ring: %s pipe reset :%s\n", ring->name,
36013603
r ? "failed" : "successfully");
36023604
if (r)
@@ -3619,10 +3621,20 @@ static int gfx_v9_4_3_reset_kcq(struct amdgpu_ring *ring,
36193621
r = amdgpu_ring_test_ring(kiq_ring);
36203622
spin_unlock_irqrestore(&kiq->ring_lock, flags);
36213623
if (r) {
3624+
if (reset_mode == AMDGPU_RESET_TYPE_PER_QUEUE)
3625+
goto pipe_reset;
3626+
36223627
dev_err(adev->dev, "fail to remap queue\n");
36233628
return r;
36243629
}
36253630

3631+
if (reset_mode == AMDGPU_RESET_TYPE_PER_QUEUE) {
3632+
r = amdgpu_ring_test_ring(ring);
3633+
if (r)
3634+
goto pipe_reset;
3635+
}
3636+
3637+
36263638
return amdgpu_ring_reset_helper_end(ring, timedout_fence);
36273639
}
36283640

0 commit comments

Comments
 (0)