Skip to contentSkip to conversation

drm/amdgpu: dequeue mes scheduler during fini

PATCH Superseded YuBiao Wang 1 participant 1 message Oct 13, 2022

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: dequeue mes scheduler during fini

[Why]
If mes is not dequeued during fini, mes will be in an uncleaned state during reload, then mes couldn't receive some commands which leads to reload failure.

[How]
Perform MES dequeue via MMIO after all the unmap jobs are done by mes and before kiq fini.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h |  3 ++
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c  |  3 ++
 drivers/gpu/drm/amd/amdgpu/mes_v11_0.c  | 47 +++++++++++++++++++++++--
 3 files changed, 50 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h +3 -0
index ad980f4b66e1..6c9208e8f027 100644
@@ -130,6 +130,9 @@ struct amdgpu_mes {
 	int                             (*kiq_hw_init)(struct amdgpu_device *adev);
 	int                             (*kiq_hw_fini)(struct amdgpu_device *adev);
 
+	/* dequeue sched pipe via kiq */
+	void							(*kiq_dequeue_sched)(struct amdgpu_device *adev);
+
 	/* ip specific functions */
 	const struct amdgpu_mes_funcs   *funcs;
 };
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +3 -0
index 257b2e4de600..7c75758f58e1 100644
@@ -4406,6 +4406,9 @@ static int gfx_v11_0_hw_fini(void *handle)
 		if (amdgpu_gfx_disable_kcq(adev))
 			DRM_ERROR("KCQ disable failed\n");
 
+		if (adev->mes.ring.sched.ready && adev->mes.kiq_dequeue_sched)
+			adev->mes.kiq_dequeue_sched(adev);
+
 		amdgpu_mes_kiq_hw_fini(adev);
 	}
 
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +44 -3

71 lines not on this page · raw message

Signature · 1 line
2.25.1