Skip to contentSkip to conversation

drm/amdgpu set doorbell range when gpu recovery in sriov environment

PATCH Superseded Lin.Cao 1 participant 1 message Oct 27, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Lin.Cao

author
#0 lore raw

PATCH 1/1 drm/amdgpu set doorbell range when gpu recovery in sriov environment

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

---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +6 -0
index d9ccacd06fba..9074ced34277 100644
@@ -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));
Signature · 1 line
2.25.1