lkml.org 
[lkml]   [2021]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 5.10-rt+] drm/i915/gt: transform irq_disable into local_lock.
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));
\
 
 \ /
  Last update: 2021-10-07 19:00    [W:0.069 / U:0.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site