Skip to contentSkip to conversation

Revert "drm/amdgpu: don't attach the tlb fence for SI"

PATCH In review Prike Liang 2 participants 5 messages Jan 9 – Jan 12

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

PATCH 1/2 Revert "drm/amdgpu: don't attach the tlb fence for SI"

This reverts commit 47d28900bc2049379b28656cf1e527aa8598925b.

It’s better to validate VM TLB flushes in the flush‑TLB backend rather than in the generic VM layer.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -3
index 0eccb31793ca..6a2ea200d90c 100644
@@ -1069,9 +1069,7 @@ amdgpu_vm_tlb_flush(struct amdgpu_vm_update_params *params,
 	}
 
 	/* Prepare a TLB flush fence to be attached to PTs */
-	if (!params->unlocked &&
-	    /* SI doesn't support pasid or KIQ/MES */
-	    params->adev->family > AMDGPU_FAMILY_SI) {
+	if (!params->unlocked) {
 		amdgpu_vm_tlb_fence_create(params->adev, vm, fence);
 
 		/* Makes sure no PD/PT is freed before the flush */
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/2 drm/amdgpu: validate the flush_gpu_tlb_pasid()

Validate flush_gpu_tlb_pasid() availability before flushing tlb.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +4 -0
index 6d7b8bb953ae..0e67fa4338ff 100644
@@ -780,6 +780,10 @@ int amdgpu_gmc_flush_gpu_tlb_pasid(struct amdgpu_device *adev, uint16_t pasid,
 		return 0;
 
 	if (!adev->gmc.flush_pasid_uses_kiq || !ring->sched.ready) {
+
+		if (!adev->gmc.gmc_funcs->flush_gpu_tlb_pasid)
+			return 0;
+
 		if (adev->gmc.flush_tlb_needs_extra_type_2)
 			adev->gmc.gmc_funcs->flush_gpu_tlb_pasid(adev, pasid,
 								 2, all_hub,
Signature · 1 line
2.34.1
maintainer
#2 lore raw

Re: [PATCH 2/2] drm/amdgpu: validate the flush_gpu_tlb_pasid()

Quoted 4 lines · Prike Liang

Validate flush_gpu_tlb_pasid() availability before flushing tlb.

This patch set needs to be re-ordered, e.g. this patch here first and then the other one.

Otherwise you have a state in between where it is broken again.

Apart from that looks good to me.

Regards,
Christian.

Quoted 19 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +4 -0
index 6d7b8bb953ae..0e67fa4338ff 100644
@@ -780,6 +780,10 @@ int amdgpu_gmc_flush_gpu_tlb_pasid(struct amdgpu_device *adev, uint16_t pasid,
 		return 0;
 
 	if (!adev->gmc.flush_pasid_uses_kiq || !ring->sched.ready) {
+
+		if (!adev->gmc.gmc_funcs->flush_gpu_tlb_pasid)
+			return 0;
+
 		if (adev->gmc.flush_tlb_needs_extra_type_2)
 			adev->gmc.gmc_funcs->flush_gpu_tlb_pasid(adev, pasid,
 								 2, all_hub,
#3 lore raw

RE: [PATCH 2/2] drm/amdgpu: validate the flush_gpu_tlb_pasid()

[Public]

Yes, I missed that they can be merged separately. I’ll reorder the patch list when merging them.

Regards,
Prike

Quoted 44 lines

-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Friday, January 9, 2026 5:09 PM
To: Liang, Prike <[email protected]>; [email protected]
Cc: Deucher, Alexander <[email protected]>; [email protected]
Subject: Re: [PATCH 2/2] drm/amdgpu: validate the flush_gpu_tlb_pasid()

Quoted 4 lines · Prike Liang

Validate flush_gpu_tlb_pasid() availability before flushing tlb.

This patch set needs to be re-ordered, e.g. this patch here first and then the other one.

Otherwise you have a state in between where it is broken again.

Apart from that looks good to me.

Regards,
Christian.

Review

Quoted 5 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 4 ++++
 1 file changed, 4 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c int amdgpu_gmc_flush_gpu_tlb_pasid(struct

Quoted 4 lines

index 6d7b8bb953ae..0e67fa4338ff 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -0
@@ -780,6 +780,10 @@ int amdgpu_gmc_flush_gpu_tlb_pasid(struct

amdgpu_device *adev, uint16_t pasid,

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +4 -0
            return 0;
 
    if (!adev->gmc.flush_pasid_uses_kiq || !ring->sched.ready) {
+
+           if (!adev->gmc.gmc_funcs->flush_gpu_tlb_pasid)
+                   return 0;
+
            if (adev->gmc.flush_tlb_needs_extra_type_2)
                    adev->gmc.gmc_funcs->flush_gpu_tlb_pasid(adev, pasid,
                                                             2, all_hub,
maintainer Reviewed-by on v1 1/2
#4 lore raw
In reply to Prike Liang
Quoted 6 lines · Prike Liang

This reverts commit 47d28900bc2049379b28656cf1e527aa8598925b.

It’s better to validate VM TLB flushes in the flush‑TLB backend rather than in the generic VM layer.

Quoted 19 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -3
index 0eccb31793ca..6a2ea200d90c 100644
@@ -1069,9 +1069,7 @@ amdgpu_vm_tlb_flush(struct amdgpu_vm_update_params *params,
 	}
 
 	/* Prepare a TLB flush fence to be attached to PTs */
-	if (!params->unlocked &&
-	    /* SI doesn't support pasid or KIQ/MES */
-	    params->adev->family > AMDGPU_FAMILY_SI) {
+	if (!params->unlocked) {
 		amdgpu_vm_tlb_fence_create(params->adev, vm, fence);
 
 		/* Makes sure no PD/PT is freed before the flush */