All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5.10-rt+] drm/i915/gt: transform irq_disable into local_lock.
@ 2021-10-07 16:59 Joe Korty
  2021-10-07 17:19 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 10+ messages in thread
From: Joe Korty @ 2021-10-07 16:59 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Sebastian Andrzej Siewior, Steven Rostedt, Clark Williams,
	Jun Miao, linux-rt-users, linux-kernel

Convert IRQ blocking in intel_breadcrumbs_park() to a local lock.

Affects 5.10-rt and all later releases, up to and including when
rt was merged into mainline.

This problem has been reported in two other linux-rt-users postings,
  
   [PREEMPT_RT] i915: fix PREEMPT_RT locking splats (Clark Williams)
   [linux-5.12.y-rt] drm/i915/gt: Fix a lockdep warning with interrupts enabled (Jun Miao)

Neither of these submit the obvious solution, nor,
AFAICT, has either yet been acted on.  So I muddy the
waters further by submitting this, a third fix.

Signed-off-by: Joe Korty <joe.korty@concurrent-rt.com>
Tested-by: Joe Korty <joe.korty@concurrent-rt.com>

Index: b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
===================================================================
--- a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
+++ b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
@@ -34,6 +34,16 @@
 #include "intel_gt_pm.h"
 #include "intel_gt_requests.h"
 
+#include <linux/local_lock.h>
+
+struct event_lock {
+	local_lock_t l;
+};
+
+static DEFINE_PER_CPU(struct event_lock, event_lock) = {
+	.l = INIT_LOCAL_LOCK(l),
+};
+
 static bool irq_enable(struct intel_engine_cs *engine)
 {
 	if (!engine->irq_enable)
@@ -342,9 +352,9 @@ void intel_breadcrumbs_park(struct intel
 	/* Kick the work once more to drain the signalers */
 	irq_work_sync(&b->irq_work);
 	while (unlikely(READ_ONCE(b->irq_armed))) {
-		local_irq_disable();
+		local_lock_irq(&event_lock.l);
 		signal_irq_work(&b->irq_work);
-		local_irq_enable();
+		local_unlock_irq(&event_lock.l);
 		cond_resched();
 	}
 	GEM_BUG_ON(!list_empty(&b->signalers));

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

end of thread, other threads:[~2021-11-30 22:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-07 16:59 [PATCH 5.10-rt+] drm/i915/gt: transform irq_disable into local_lock Joe Korty
2021-10-07 17:19 ` Sebastian Andrzej Siewior
2021-10-09 16:49   ` Joe Korty
2021-11-16 20:25     ` Steven Rostedt
2021-11-16 21:02       ` Sebastian Andrzej Siewior
2021-11-16 21:39         ` Steven Rostedt
2021-11-22 19:50           ` Joe Korty
2021-11-22 20:32             ` Steven Rostedt
2021-11-30 15:10             ` Sebastian Andrzej Siewior
2021-11-30 22:03               ` Joe Korty

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.