GFX doorbell range should be set after flr otherwise the GFX doorbell
range will overlap with MEC.

Signed-off-by: Lin.Cao <linca...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index d9ccacd06fba..9074ced34277 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -6467,6 +6467,12 @@ static int gfx_v10_0_gfx_init_queue(struct amdgpu_ring 
*ring)
                if (adev->gfx.me.mqd_backup[mqd_idx])
                        memcpy(adev->gfx.me.mqd_backup[mqd_idx], mqd, 
sizeof(*mqd));
        } else {
+               if (amdgpu_sriov_vf(adev) && amdgpu_in_reset(adev)) {
+                       mutex_lock(&adev->srbm_mutex);
+                       if (ring->doorbell_index == 
adev->doorbell_index.gfx_ring0 << 1)
+                               gfx_v10_0_cp_gfx_set_doorbell(adev, ring);
+                       mutex_unlock(&adev->srbm_mutex);
+               }
                /* restore mqd with the backup copy */
                if (adev->gfx.me.mqd_backup[mqd_idx])
                        memcpy(mqd, adev->gfx.me.mqd_backup[mqd_idx], 
sizeof(*mqd));
-- 
2.25.1

Reply via email to