All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-xe] [PATCH] drm/xe: Fix an invalid locking wait context bug
@ 2023-07-19 19:27 Rodrigo Vivi
  2023-07-19 21:07 ` [Intel-xe] ✓ CI.Patch_applied: success for " Patchwork
                   ` (21 more replies)
  0 siblings, 22 replies; 33+ messages in thread
From: Rodrigo Vivi @ 2023-07-19 19:27 UTC (permalink / raw)
  To: intel-xe; +Cc: Matthew Auld, Rodrigo Vivi

xe_irq_{suspend,resume} were incorrectly using the xe->irq.lock.

The lock was created to protect the gt irq handlers, and not
the irq.enabled. Since suspend/resume and other places touching
irq.enabled are already serialized they don't need protection.
(see other irq.enabled accesses).

Then with this spin lock around xe_irq_reset, we will end up
calling the intel_display_power_is_enabled() function, and
that needs a mutex lock. Hence causing the undesired
"[ BUG: Invalid wait context ]"

Cc: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/xe/xe_irq.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_irq.c b/drivers/gpu/drm/xe/xe_irq.c
index eae190cb0969..df01af780a57 100644
--- a/drivers/gpu/drm/xe/xe_irq.c
+++ b/drivers/gpu/drm/xe/xe_irq.c
@@ -574,10 +574,8 @@ void xe_irq_shutdown(struct xe_device *xe)
 
 void xe_irq_suspend(struct xe_device *xe)
 {
-	spin_lock_irq(&xe->irq.lock);
 	xe->irq.enabled = false;
 	xe_irq_reset(xe);
-	spin_unlock_irq(&xe->irq.lock);
 }
 
 void xe_irq_resume(struct xe_device *xe)
@@ -585,13 +583,10 @@ void xe_irq_resume(struct xe_device *xe)
 	struct xe_gt *gt;
 	int id;
 
-	spin_lock_irq(&xe->irq.lock);
 	xe->irq.enabled = true;
 	xe_irq_reset(xe);
 	xe_irq_postinstall(xe);
 
 	for_each_gt(gt, xe, id)
 		xe_irq_enable_hwe(gt);
-
-	spin_unlock_irq(&xe->irq.lock);
 }
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2023-07-27 16:08 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-19 19:27 [Intel-xe] [PATCH] drm/xe: Fix an invalid locking wait context bug Rodrigo Vivi
2023-07-19 21:07 ` [Intel-xe] ✓ CI.Patch_applied: success for " Patchwork
2023-07-19 21:07 ` [Intel-xe] ✓ CI.checkpatch: " Patchwork
2023-07-19 21:08 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-07-19 21:12 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-07-19 21:12 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-07-19 21:14 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-07-19 21:14 ` [Intel-xe] [PATCH] " Matthew Brost
2023-07-20  9:11 ` Matthew Auld
2023-07-20 12:01   ` Rodrigo Vivi
2023-07-20 12:38     ` Matthew Auld
2023-07-20 15:42       ` Rodrigo Vivi
2023-07-21 11:17         ` Matthew Auld
2023-07-21 18:44           ` Rodrigo Vivi
2023-07-25 20:17   ` Rodrigo Vivi
2023-07-26 11:38     ` Matthew Auld
2023-07-26 17:24       ` Rodrigo Vivi
2023-07-26 21:30         ` Rodrigo Vivi
2023-07-27 16:08           ` Matthew Auld
2023-07-25 20:20 ` [Intel-xe] ✓ CI.Patch_applied: success for drm/xe: Fix an invalid locking wait context bug (rev2) Patchwork
2023-07-25 20:20 ` [Intel-xe] ✓ CI.checkpatch: " Patchwork
2023-07-25 20:21 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-07-25 20:25 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-07-25 20:25 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-07-25 20:27 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-07-25 20:45 ` [Intel-xe] ○ CI.BAT: info " Patchwork
2023-07-26 22:29 ` [Intel-xe] ✓ CI.Patch_applied: success for drm/xe: Fix an invalid locking wait context bug (rev3) Patchwork
2023-07-26 22:29 ` [Intel-xe] ✓ CI.checkpatch: " Patchwork
2023-07-26 22:30 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-07-26 22:34 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-07-26 22:34 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-07-26 22:35 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-07-26 23:10 ` [Intel-xe] ○ CI.BAT: info " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.