Skip to contentSkip to conversation

drm/amdgpu: validate the flush_gpu_tlb_pasid()

PATCH In review Prike Liang 3 participants 6 messages Jan 6 – Jan 8

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

PATCH 1/1 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 cd4acc6adc9e..f871f1693483 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
#1 lore raw

[Public]

Add Jean

Regards,
Prike

Quoted 34 lines

-----Original Message-----
From: Liang, Prike <[email protected]>
Sent: Tuesday, January 6, 2026 9:19 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Liang, Prike <[email protected]>
Subject: [PATCH] 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 cd4acc6adc9e..f871f1693483 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,

--
2.34.1

#2 lore raw

Since 6.17.11 and 6.18.1, the patch 'attach tlb fence to the PTs update' (commit b4a7f4e7ad2b120a94f3111f92a11520052c762d) provoked a kernel crash on my system with an AMD SI graphic chip.

I confirm this 'validate the flush_gpu_tlb_pasid()' patch solves this issue.

J. Ph.

Le 07/01/2026 à 02:50, Liang, Prike a écrit :

Quoted 41 lines

[Public]

Add Jean

Regards,
Prike

Quoted 34 lines

-----Original Message-----
From: Liang, Prike <[email protected]>
Sent: Tuesday, January 6, 2026 9:19 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Liang, Prike <[email protected]>
Subject: [PATCH] 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 cd4acc6adc9e..f871f1693483 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,

--
2.34.1

maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Prike Liang
Quoted 3 lines · Prike Liang

Validate flush_gpu_tlb_pasid() availability before flushing tlb.

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 cd4acc6adc9e..f871f1693483 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,
#4 lore raw

[Public]

Hi Alex

This patch should fix the TLB flush support issue on the older GFX.
Do you think we should revert the following change to clean up the VM layer flush quirk?

https://lists.freedesktop.org/archives/amd-gfx/2025-December/134959.html

Regards,
Prike

Quoted 35 lines

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

Quoted 3 lines · Prike Liang

Validate flush_gpu_tlb_pasid() availability before flushing tlb.

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 cd4acc6adc9e..f871f1693483 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
#5 lore raw
Quoted 6 lines · Prike

[Public]

Hi Alex

This patch should fix the TLB flush support issue on the older GFX.
Do you think we should revert the following change to clean up the VM layer flush quirk?

Yeah, agree. The patch below is much cleaner than this quirk.

Regards,
Christian.

Quoted 42 lines

https://lists.freedesktop.org/archives/amd-gfx/2025-December/134959.html

Regards,
Prike

Quoted 35 lines

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

Quoted 3 lines · Prike Liang

Validate flush_gpu_tlb_pasid() availability before flushing tlb.

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 cd4acc6adc9e..f871f1693483 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,