Skip to contentSkip to conversation

drm/amd/amdgpu: Fix the mes version that support inv_tlbs

PATCH In review Shaoyun Liu 2 participants 2 messages Sep 11, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/amdgpu: Fix the mes version that support inv_tlbs

MES pipe0 will do VM invalidation with engine set 5 when assign VMID to a process, driver will submit inv_tlb package to mes pipe1. It might run into race condition if both pipes use the same invalidate engine set. From MES version 0x83 it will use invalidate engine set 6 for pipe1 to fix the issue

---
 drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c +1 -1
index 76d3c40735b0..7cc16af1868b 100644
@@ -337,7 +337,7 @@ static void gmc_v12_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev,
 	int vmid, i;
 
 	if (adev->enable_uni_mes && adev->mes.ring[AMDGPU_MES_SCHED_PIPE].sched.ready &&
-	    (adev->mes.sched_version & AMDGPU_MES_VERSION_MASK) >= 0x81) {
+	    (adev->mes.sched_version & AMDGPU_MES_VERSION_MASK) >= 0x83) {
 		struct mes_inv_tlbs_pasid_input input = {0};
 		input.pasid = pasid;
 		input.flush_type = flush_type;
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Shaoyun Liu

MES pipe0 will do VM invalidation with engine set 5 when assign VMID to a process, driver will submit inv_tlb package to mes pipe1. It might run into race condition if both pipes use the same invalidate engine set. From MES version 0x83 it will use invalidate engine set 6 for pipe1 to fix the issue

Fixes 87e65052616c ("drm/amd/amdgpu : Use the MES INV_TLBS API for

tlb invalidation on gfx12")

Quoted 20 lines
---
 drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c +1 -2
index 76d3c40735b0..7cc16af1868b 100644
@@ -337,7 +337,7 @@ static void gmc_v12_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev,
        int vmid, i;
 
        if (adev->enable_uni_mes && adev->mes.ring[AMDGPU_MES_SCHED_PIPE].sched.ready &&
-           (adev->mes.sched_version & AMDGPU_MES_VERSION_MASK) >= 0x81) {
+           (adev->mes.sched_version & AMDGPU_MES_VERSION_MASK) >= 0x83) {
                struct mes_inv_tlbs_pasid_input input = {0};
                input.pasid = pasid;
                input.flush_type = flush_type;
--

2.34.1