Skip to contentSkip to conversation

Revert "drm/amdgpu: attach tlb fence to the PTs update"

PATCH In review Alex Deucher 5 participants 7 messages Mar 4 – Mar 13

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 Revert "drm/amdgpu: attach tlb fence to the PTs update"

This reverts commit f3854e04b708d73276c4488231a8bd66d30b4671.

This causes framebuffer corruption after suspend.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
index 01fef0e4f4085..25b1d679ba262 100644
@@ -1073,7 +1073,7 @@ amdgpu_vm_tlb_flush(struct amdgpu_vm_update_params *params,
 	}
 
 	/* Prepare a TLB flush fence to be attached to PTs */
-	if (!params->unlocked) {
+	if (!params->unlocked && vm->is_compute_context) {
 		amdgpu_vm_tlb_fence_create(params->adev, vm, fence);
 
 		/* Makes sure no PD/PT is freed before the flush */
Signature · 1 line
2.53.0
maintainer
#1 lore raw
Quoted 3 lines · Alex Deucher

This reverts commit f3854e04b708d73276c4488231a8bd66d30b4671.

This causes framebuffer corruption after suspend.

But prevents massive memory corruption with userqueues.

I have strong doubts that this is related to the FB corruption in any way, it will just change the timing.

Regards,
Christian.

Quoted 22 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
index 01fef0e4f4085..25b1d679ba262 100644
@@ -1073,7 +1073,7 @@ amdgpu_vm_tlb_flush(struct amdgpu_vm_update_params *params,
 	}
 
 	/* Prepare a TLB flush fence to be attached to PTs */
-	if (!params->unlocked) {
+	if (!params->unlocked && vm->is_compute_context) {
 		amdgpu_vm_tlb_fence_create(params->adev, vm, fence);
 
 		/* Makes sure no PD/PT is freed before the flush */
#2 lore raw

[Public]

It’s possible that we failed to save and invalidate some active pages during suspend, which then prevents those pages from being restored correctly on resume.

For now, we still rely on this patch to keep the userq page tables updated and synchronized. Until the full solution is ready, how about we fall back to the initial approach and restrict this TLB flush to only the userq path?

Regards,
Prike

Quoted 45 lines

-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Wednesday, March 4, 2026 9:57 PM
To: Deucher, Alexander <[email protected]>; amd- [email protected]
Cc: Liang, Prike <[email protected]>
Subject: Re: [PATCH] Revert "drm/amdgpu: attach tlb fence to the PTs update"

Quoted 3 lines · Alex Deucher

This reverts commit f3854e04b708d73276c4488231a8bd66d30b4671.

This causes framebuffer corruption after suspend.

But prevents massive memory corruption with userqueues.

I have strong doubts that this is related to the FB corruption in any way, it will just change the timing.

Regards,
Christian.

Review

Quoted 10 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

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

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c amdgpu_vm_tlb_flush(struct

Quoted 4 lines

index 01fef0e4f4085..25b1d679ba262 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
@@ -1073,7 +1073,7 @@ amdgpu_vm_tlb_flush(struct

amdgpu_vm_update_params *params,

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
    }
 
    /* Prepare a TLB flush fence to be attached to PTs */
-   if (!params->unlocked) {
+   if (!params->unlocked && vm->is_compute_context) {
            amdgpu_vm_tlb_fence_create(params->adev, vm, fence);
 
            /* Makes sure no PD/PT is freed before the flush */
maintainer
#3 lore raw

The original reporter already mentioned on the ticket that this patch is not the actual cause of the issues.

It basically just changes timing to create and eventually wait for the TLB fence to signal.

Let's see what the reporter finds with his extended bisect.

Regards,
Christian.

Quoted 55 lines · Prike

[Public]

It’s possible that we failed to save and invalidate some active pages during suspend, which then prevents those pages from being restored correctly on resume.

For now, we still rely on this patch to keep the userq page tables updated and synchronized. Until the full solution is ready, how about we fall back to the initial approach and restrict this TLB flush to only the userq path?

Regards,
Prike

Quoted 45 lines

-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Wednesday, March 4, 2026 9:57 PM
To: Deucher, Alexander <[email protected]>; amd- [email protected]
Cc: Liang, Prike <[email protected]>
Subject: Re: [PATCH] Revert "drm/amdgpu: attach tlb fence to the PTs update"

Quoted 3 lines · Alex Deucher

This reverts commit f3854e04b708d73276c4488231a8bd66d30b4671.

This causes framebuffer corruption after suspend.

But prevents massive memory corruption with userqueues.

I have strong doubts that this is related to the FB corruption in any way, it will just change the timing.

Regards,
Christian.

Review

Quoted 10 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

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

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c amdgpu_vm_tlb_flush(struct

Quoted 4 lines

index 01fef0e4f4085..25b1d679ba262 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
@@ -1073,7 +1073,7 @@ amdgpu_vm_tlb_flush(struct

amdgpu_vm_update_params *params,

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
    }
 
    /* Prepare a TLB flush fence to be attached to PTs */
-   if (!params->unlocked) {
+   if (!params->unlocked && vm->is_compute_context) {
            amdgpu_vm_tlb_fence_create(params->adev, vm, fence);
 
            /* Makes sure no PD/PT is freed before the flush */
#4 lore raw

There is actually a contingent of two people who claim that this patch is the cause for MES resets here:

https://gitlab.freedesktop.org/drm/amd/-/issues/4749

Quoted 67 lines · Christian König

The original reporter already mentioned on the ticket that this patch is not the actual cause of the issues.

It basically just changes timing to create and eventually wait for the TLB fence to signal.

Let's see what the reporter finds with his extended bisect.

Regards,
Christian.

Quoted 55 lines · Prike

[Public]

It’s possible that we failed to save and invalidate some active pages during suspend, which then prevents those pages from being restored correctly on resume.

For now, we still rely on this patch to keep the userq page tables updated and synchronized. Until the full solution is ready, how about we fall back to the initial approach and restrict this TLB flush to only the userq path?

Regards,
Prike

Quoted 45 lines

-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Wednesday, March 4, 2026 9:57 PM
To: Deucher, Alexander <[email protected]>; amd- [email protected]
Cc: Liang, Prike <[email protected]>
Subject: Re: [PATCH] Revert "drm/amdgpu: attach tlb fence to the PTs update"

Quoted 3 lines · Alex Deucher

This reverts commit f3854e04b708d73276c4488231a8bd66d30b4671.

This causes framebuffer corruption after suspend.

But prevents massive memory corruption with userqueues.

I have strong doubts that this is related to the FB corruption in any way, it will just change the timing.

Regards,
Christian.

Review

Quoted 10 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

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

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c amdgpu_vm_tlb_flush(struct

Quoted 4 lines

index 01fef0e4f4085..25b1d679ba262 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
@@ -1073,7 +1073,7 @@ amdgpu_vm_tlb_flush(struct

amdgpu_vm_update_params *params,

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
     }
 
     /* Prepare a TLB flush fence to be attached to PTs */
-   if (!params->unlocked) {
+   if (!params->unlocked && vm->is_compute_context) {
             amdgpu_vm_tlb_fence_create(params->adev, vm, fence);
 
             /* Makes sure no PD/PT is freed before the flush */
maintainer
#5 lore raw

Yeah, but that is still not the root cause.

Attaching the TLB fence all the time just makes more use of the MES, it doesn't cause any additional problems which wouldn't have been there before.

Regards,
Christian.

Quoted 74 lines · Mario Limonciello

There is actually a contingent of two people who claim that this patch is the cause for MES resets here:

https://gitlab.freedesktop.org/drm/amd/-/issues/4749

Quoted 67 lines · Christian König

The original reporter already mentioned on the ticket that this patch is not the actual cause of the issues.

It basically just changes timing to create and eventually wait for the TLB fence to signal.

Let's see what the reporter finds with his extended bisect.

Regards,
Christian.

Quoted 55 lines · Prike

[Public]

It’s possible that we failed to save and invalidate some active pages during suspend, which then prevents those pages from being restored correctly on resume.

For now, we still rely on this patch to keep the userq page tables updated and synchronized. Until the full solution is ready, how about we fall back to the initial approach and restrict this TLB flush to only the userq path?

Regards,
       Prike

Quoted 45 lines

-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Wednesday, March 4, 2026 9:57 PM
To: Deucher, Alexander <[email protected]>; amd- [email protected]
Cc: Liang, Prike <[email protected]>
Subject: Re: [PATCH] Revert "drm/amdgpu: attach tlb fence to the PTs update"

Quoted 3 lines · Alex Deucher

This reverts commit f3854e04b708d73276c4488231a8bd66d30b4671.

This causes framebuffer corruption after suspend.

But prevents massive memory corruption with userqueues.

I have strong doubts that this is related to the FB corruption in any way, it will just change the timing.

Regards,
Christian.

Review

Quoted 10 lines

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

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

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c amdgpu_vm_tlb_flush(struct

Quoted 4 lines

index 01fef0e4f4085..25b1d679ba262 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
@@ -1073,7 +1073,7 @@ amdgpu_vm_tlb_flush(struct

amdgpu_vm_update_params *params,

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
      }
 
      /* Prepare a TLB flush fence to be attached to PTs */
-   if (!params->unlocked) {
+   if (!params->unlocked && vm->is_compute_context) {
              amdgpu_vm_tlb_fence_create(params->adev, vm, fence);
 
              /* Makes sure no PD/PT is freed before the flush */
#6 lore raw

Well the original patch was intended for userq but is causing issues on systems without userq. How about just narrowing it down to only userq for now until we have a root cause?

Quoted 84 lines · Christian König

Yeah, but that is still not the root cause.

Attaching the TLB fence all the time just makes more use of the MES, it doesn't cause any additional problems which wouldn't have been there before.

Regards,
Christian.

Quoted 74 lines · Mario Limonciello

There is actually a contingent of two people who claim that this patch is the cause for MES resets here:

https://gitlab.freedesktop.org/drm/amd/-/issues/4749

Quoted 67 lines · Christian König

The original reporter already mentioned on the ticket that this patch is not the actual cause of the issues.

It basically just changes timing to create and eventually wait for the TLB fence to signal.

Let's see what the reporter finds with his extended bisect.

Regards,
Christian.

Quoted 55 lines · Prike

[Public]

It’s possible that we failed to save and invalidate some active pages during suspend, which then prevents those pages from being restored correctly on resume.

For now, we still rely on this patch to keep the userq page tables updated and synchronized. Until the full solution is ready, how about we fall back to the initial approach and restrict this TLB flush to only the userq path?

Regards,
       Prike

Quoted 45 lines

-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Wednesday, March 4, 2026 9:57 PM
To: Deucher, Alexander <[email protected]>; amd- [email protected]
Cc: Liang, Prike <[email protected]>
Subject: Re: [PATCH] Revert "drm/amdgpu: attach tlb fence to the PTs update"

Quoted 3 lines · Alex Deucher

This reverts commit f3854e04b708d73276c4488231a8bd66d30b4671.

This causes framebuffer corruption after suspend.

But prevents massive memory corruption with userqueues.

I have strong doubts that this is related to the FB corruption in any way, it will just change the timing.

Regards,
Christian.

Review

Quoted 10 lines
---
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

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

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c amdgpu_vm_tlb_flush(struct

Quoted 4 lines

index 01fef0e4f4085..25b1d679ba262 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
@@ -1073,7 +1073,7 @@ amdgpu_vm_tlb_flush(struct

amdgpu_vm_update_params *params,

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
      }
 
      /* Prepare a TLB flush fence to be attached to PTs */
-   if (!params->unlocked) {
+   if (!params->unlocked && vm->is_compute_context) {
              amdgpu_vm_tlb_fence_create(params->adev, vm, fence);
 
              /* Makes sure no PD/PT is freed before the flush */