lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20190821163314.9830-1-clark.williams@gmail.com>
Date:   Wed, 21 Aug 2019 11:33:14 -0500
From:   Clark Williams <clark.williams@...il.com>
To:     bigeasy@...utronix.org
Cc:     tglx@...utronix.org, linux-kernel@...r.kernel.org,
        linux-rt-users@....kernel.org
Subject: [PATCH] i915: reduce scope of irq disable when signaling breadcrumbs

From: Clark Williams <williams@...hat.com>

Rather than disable irqs around the call to intel_engine_breadcrumbs_irq()
use raw_spin_lock_irq() around the signalers loop inside
intel_engine_breadcrumbs_irq().

It's entirely possible that we only need local_irq_{disable, enable} around
the call to __intel_breadcrumbs_disarm_irq() but for now just use the
raw_spin_lock_irq() call to disable irqs (and preemption).

This prevents a debug splat on PREEMPT_RT where the request lock is taken
in atomic context.

Signed-off-by: Clark Williams <williams@...hat.com>
---
 drivers/gpu/drm/i915/intel_breadcrumbs.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c
index 32ebbe887e61..b393421ddf06 100644
--- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
+++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
@@ -119,7 +119,7 @@ void intel_engine_breadcrumbs_irq(struct intel_engine_cs *engine)
 	struct list_head *pos, *next;
 	LIST_HEAD(signal);
 
-	raw_spin_lock(&b->irq_lock);
+	raw_spin_lock_irq(&b->irq_lock);
 
 	if (b->irq_armed && list_empty(&b->signalers))
 		__intel_breadcrumbs_disarm_irq(b);
@@ -163,7 +163,7 @@ void intel_engine_breadcrumbs_irq(struct intel_engine_cs *engine)
 		}
 	}
 
-	raw_spin_unlock(&b->irq_lock);
+	raw_spin_unlock_irq(&b->irq_lock);
 
 	list_for_each_safe(pos, next, &signal) {
 		struct i915_request *rq =
@@ -181,9 +181,7 @@ void intel_engine_breadcrumbs_irq(struct intel_engine_cs *engine)
 
 void intel_engine_signal_breadcrumbs(struct intel_engine_cs *engine)
 {
-	local_irq_disable();
 	intel_engine_breadcrumbs_irq(engine);
-	local_irq_enable();
 }
 
 static void signal_irq_work(struct irq_work *work)
-- 
2.21.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ