drm/msm: skip re-emitting IBs for unusable VMs
Subsystems (4)
PATCH 1/1 drm/msm: skip re-emitting IBs for unusable VMs
When a VM is marked as an usuable we disallow new submissions from it, however submissions that where already scheduled on the ring would still be re-sent.
Since this can lead to further hangs, avoid emitting the actual IBs.
--- drivers/gpu/drm/msm/msm_gpu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/msm_gpu.c +8 -1
@@ -553,8 +553,15 @@ static void recover_worker(struct kthread_work *work)unsigned long flags;spin_lock_irqsave (&ring->submit_lock, flags); -list_for_each_entry (submit, &ring->submits, node) +list_for_each_entry (submit, &ring->submits, node) { +/* +* If the submit uses an unusable vm make sure +* we don't actually run it +*/ +if (to_msm_vm (submit->vm)->unusable) + submit->nr_cmds =0 ; gpu->funcs->submit (gpu, submit); + }spin_unlock_irqrestore (&ring->submit_lock, flags); } }
---
base-commit: 8290d37ad2b087bbcfe65fa5bcaf260e184b250a
change-id: 20250813-unusable_fix_b4-10bde6f3b756
Best regards,
Signature · 1 line
Antonino Maniscalco <[email protected]>
Akhil P Oommen
reviewerQuoted 18 lines · Antonino Maniscalco
When a VM is marked as an usuable we disallow new submissions from it, however submissions that where already scheduled on the ring would still be re-sent.
Since this can lead to further hangs, avoid emitting the actual IBs.
Fixes 6a4d287a1ae6 ("drm/msm: Mark VM as unusable on GPU hangs")Signed-off-by Antonino Maniscalco <[email protected]>--- drivers/gpu/drm/msm/msm_gpu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)drivers/gpu/drm/msm/msm_gpu.c +0
-0@@ -553,8 +553,15 @@ static void recover_worker(struct kthread_work *work)unsigned long flags;
drivers/gpu/drm/msm/msm_gpu.c static void recover_worker(struct kthread_work *work) · line 562
Quoted 10 lines
drivers/gpu/drm/msm/msm_gpu.c +7
-1spin_lock_irqsave (&ring->submit_lock, flags); -list_for_each_entry (submit, &ring->submits, node) +list_for_each_entry (submit, &ring->submits, node) { +/* +* If the submit uses an unusable vm make sure +* we don't actually run it +*/ +if (to_msm_vm (submit->vm)->unusable) + submit->nr_cmds =0 ;
Just curious, why not just retire this submit here?
-Akhil
Quoted 11 lines
drivers/gpu/drm/msm/msm_gpu.c +1
-1gpu->funcs->submit (gpu, submit); + }spin_unlock_irqrestore (&ring->submit_lock, flags); } } ---base-commit:
8290d37ad2b087bbcfe65fa5bcaf260e184b250a
change-id: 20250813-unusable_fix_b4-10bde6f3b756Best regards,
Quoted 21 lines · Akhil P Oommen
Quoted 19 lines · Antonino Maniscalco
When a VM is marked as an usuable we disallow new submissions from it, however submissions that where already scheduled on the ring would still be re-sent.
Since this can lead to further hangs, avoid emitting the actual IBs.
Fixes 6a4d287a1ae6 ("drm/msm: Mark VM as unusable on GPU hangs")Signed-off-by Antonino Maniscalco <[email protected]>--- drivers/gpu/drm/msm/msm_gpu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)drivers/gpu/drm/msm/msm_gpu.c +0
-0@@ -553,8 +553,15 @@ static void recover_worker(struct kthread_work *work)unsigned long flags;
Quoted 11 lines
drivers/gpu/drm/msm/msm_gpu.c static void recover_worker(struct kthread_work *work) · line 562
Quoted 9 lines
drivers/gpu/drm/msm/msm_gpu.c +7
-1spin_lock_irqsave (&ring->submit_lock, flags); -list_for_each_entry (submit, &ring->submits, node) +list_for_each_entry (submit, &ring->submits, node) { +/* +* If the submit uses an unusable vm make sure +* we don't actually run it +*/ +if (to_msm_vm (submit->vm)->unusable) + submit->nr_cmds =0 ;Just curious, why not just retire this submit here?
Because then you'd end up with submits retiring out of order (ie. fences on the same timeline signaling out of order)
BR,
-R
Quoted 14 lines
-Akhil
Quoted 11 lines
drivers/gpu/drm/msm/msm_gpu.c +1
-1gpu->funcs->submit (gpu, submit); + }spin_unlock_irqrestore (&ring->submit_lock, flags); } } ---base-commit:
8290d37ad2b087bbcfe65fa5bcaf260e184b250a
change-id: 20250813-unusable_fix_b4-10bde6f3b756Best regards,
Quoted 34 lines · Rob Clark
Quoted 21 lines · Akhil P Oommen
Quoted 19 lines · Antonino Maniscalco
When a VM is marked as an usuable we disallow new submissions from it, however submissions that where already scheduled on the ring would still be re-sent.
Since this can lead to further hangs, avoid emitting the actual IBs.
Fixes 6a4d287a1ae6 ("drm/msm: Mark VM as unusable on GPU hangs")Signed-off-by Antonino Maniscalco <[email protected]>--- drivers/gpu/drm/msm/msm_gpu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)drivers/gpu/drm/msm/msm_gpu.c +0
-0@@ -553,8 +553,15 @@ static void recover_worker(struct kthread_work *work)unsigned long flags;Quoted 11 lines
drivers/gpu/drm/msm/msm_gpu.c static void recover_worker(struct kthread_work *work) · line 562
Quoted 9 lines
drivers/gpu/drm/msm/msm_gpu.c +7
-1spin_lock_irqsave (&ring->submit_lock, flags); -list_for_each_entry (submit, &ring->submits, node) +list_for_each_entry (submit, &ring->submits, node) { +/* +* If the submit uses an unusable vm make sure +* we don't actually run it +*/ +if (to_msm_vm (submit->vm)->unusable) + submit->nr_cmds =0 ;Just curious, why not just retire this submit here?
Quoted 2 lines
Because then you'd end up with submits retiring out of order (ie. fences on the same timeline signaling out of order)
Yeah, that makes sense.
-Akhil
Quoted 18 lines
BR,
-RQuoted 14 lines
-Akhil
Quoted 11 lines
drivers/gpu/drm/msm/msm_gpu.c +1
-1gpu->funcs->submit (gpu, submit); + }spin_unlock_irqrestore (&ring->submit_lock, flags); } } ---base-commit:
8290d37ad2b087bbcfe65fa5bcaf260e184b250a
change-id: 20250813-unusable_fix_b4-10bde6f3b756Best regards,