Skip to content

Commit ec4927d

Browse files
vizhaoalexdeucher
authored andcommitted
drm/amdgpu: fix for suspend/resume sequence under sriov
- clear kiq ring after suspend/resume under sriov to aviod kiq ring test failure - update irq after resume to fix kiq interrput loss Signed-off-by: Victor Zhao <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 5cefe31 commit ec4927d

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4197,6 +4197,8 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
41974197
}
41984198

41994199
/* Make sure IB tests flushed */
4200+
if (amdgpu_sriov_vf(adev))
4201+
amdgpu_irq_gpu_reset_resume_helper(adev);
42004202
flush_delayed_work(&adev->delayed_init_work);
42014203

42024204
if (adev->in_s0ix) {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6909,6 +6909,8 @@ static int gfx_v10_0_kiq_init_queue(struct amdgpu_ring *ring)
69096909
mutex_unlock(&adev->srbm_mutex);
69106910
} else {
69116911
memset((void *)mqd, 0, sizeof(*mqd));
6912+
if (amdgpu_sriov_vf(adev) && adev->in_suspend)
6913+
amdgpu_ring_clear_ring(ring);
69126914
mutex_lock(&adev->srbm_mutex);
69136915
nv_grbm_select(adev, ring->me, ring->pipe, ring->queue, 0);
69146916
amdgpu_ring_init_mqd(ring);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4004,6 +4004,8 @@ static int gfx_v11_0_kiq_init_queue(struct amdgpu_ring *ring)
40044004
mutex_unlock(&adev->srbm_mutex);
40054005
} else {
40064006
memset((void *)mqd, 0, sizeof(*mqd));
4007+
if (amdgpu_sriov_vf(adev) && adev->in_suspend)
4008+
amdgpu_ring_clear_ring(ring);
40074009
mutex_lock(&adev->srbm_mutex);
40084010
soc21_grbm_select(adev, ring->me, ring->pipe, ring->queue, 0);
40094011
amdgpu_ring_init_mqd(ring);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4643,6 +4643,8 @@ static int gfx_v8_0_kiq_init_queue(struct amdgpu_ring *ring)
46434643
memset((void *)mqd, 0, sizeof(struct vi_mqd_allocation));
46444644
((struct vi_mqd_allocation *)mqd)->dynamic_cu_mask = 0xFFFFFFFF;
46454645
((struct vi_mqd_allocation *)mqd)->dynamic_rb_mask = 0xFFFFFFFF;
4646+
if (amdgpu_sriov_vf(adev) && adev->in_suspend)
4647+
amdgpu_ring_clear_ring(ring);
46464648
mutex_lock(&adev->srbm_mutex);
46474649
vi_srbm_select(adev, ring->me, ring->pipe, ring->queue, 0);
46484650
gfx_v8_0_mqd_init(ring);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3581,6 +3581,8 @@ static int gfx_v9_0_kiq_init_queue(struct amdgpu_ring *ring)
35813581
memset((void *)mqd, 0, sizeof(struct v9_mqd_allocation));
35823582
((struct v9_mqd_allocation *)mqd)->dynamic_cu_mask = 0xFFFFFFFF;
35833583
((struct v9_mqd_allocation *)mqd)->dynamic_rb_mask = 0xFFFFFFFF;
3584+
if (amdgpu_sriov_vf(adev) && adev->in_suspend)
3585+
amdgpu_ring_clear_ring(ring);
35843586
mutex_lock(&adev->srbm_mutex);
35853587
soc15_grbm_select(adev, ring->me, ring->pipe, ring->queue, 0);
35863588
gfx_v9_0_mqd_init(ring);

0 commit comments

Comments
 (0)