[PATCH] drm/amdgpu/gfx9: ensure mqd data take effect when gpu reset

Yintian Tao yttao at amd.com
Tue Jun 4 17:32:38 UTC 2019


We should ensure mqd data take effect when gpu reset.
Otherwise, it will rasie ring ib tests failure.

Signed-off-by: Yintian Tao <yttao at amd.com>
Signed-off-by: Monk Liu <Monk.Liu at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 2e9cac1..bea641d 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -3123,6 +3123,8 @@ static int gfx_v9_0_kiq_init_queue(struct amdgpu_ring *ring)
 		if (adev->gfx.mec.mqd_backup[mqd_idx])
 			memcpy(mqd, adev->gfx.mec.mqd_backup[mqd_idx], sizeof(struct v9_mqd_allocation));
 
+		/* clean gpu table status */
+		amdgpu_gmc_flush_gpu_tlb(adev, 0, 0);
 		/* reset ring buffer */
 		ring->wptr = 0;
 		amdgpu_ring_clear_ring(ring);
@@ -3147,6 +3149,8 @@ static int gfx_v9_0_kiq_init_queue(struct amdgpu_ring *ring)
 			memcpy(adev->gfx.mec.mqd_backup[mqd_idx], mqd, sizeof(struct v9_mqd_allocation));
 	}
 
+	/* make sure mqd data landed into VRAM */
+	amdgpu_asic_flush_hdp(adev, NULL);
 	return 0;
 }
 
-- 
2.7.4



More information about the amd-gfx mailing list