drm/amdgpu: validate the flush_gpu_tlb_pasid()
Subsystems (2)
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
@@ -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
[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 theflush_gpu_tlb_pasid()Validate
flush_gpu_tlb_pasid()availability before flushing tlb.Signed-off-by Prike Liang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +4
-0@@ -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
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,
PrikeQuoted 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 theflush_gpu_tlb_pasid()Validate
flush_gpu_tlb_pasid()availability before flushing tlb.Signed-off-by Prike Liang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +4
-0@@ -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
Quoted 3 lines · Prike Liang
Validate
flush_gpu_tlb_pasid()availability before flushing tlb.Signed-off-by Prike Liang <[email protected]>
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@@ -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,
[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 theflush_gpu_tlb_pasid()Quoted 3 lines · Prike Liang
Validate
flush_gpu_tlb_pasid()availability before flushing tlb.Signed-off-by Prike Liang <[email protected]>Reviewed-by Christian König <[email protected]>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.cdrivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c int amdgpu_gmc_flush_gpu_tlb_pasid(struct
Quoted 4 lines
index
cd4acc6adc9e..f871f1693483100644drivers/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_tpasid,Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +4
-0return 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,
Christian König
maintainerQuoted 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,
PrikeQuoted 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 theflush_gpu_tlb_pasid()Quoted 3 lines · Prike Liang
Validate
flush_gpu_tlb_pasid()availability before flushing tlb.Signed-off-by Prike Liang <[email protected]>Reviewed-by Christian König <[email protected]>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.cdrivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c int amdgpu_gmc_flush_gpu_tlb_pasid(struct
Quoted 4 lines
index
cd4acc6adc9e..f871f1693483100644drivers/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_tpasid,Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +4
-0return 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,