mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Clark Williams <clark.williams@gmail.com>
To: bigeasy@linutronix.org
Cc: tglx@linutronix.org, linux-kernel@vger.kernel.org,
	linux-rt-users@vgr.kernel.org
Subject: [PATCH] i915: reduce scope of irq disable when signaling breadcrumbs
Date: Wed, 21 Aug 2019 11:33:14 -0500	[thread overview]
Message-ID: <20190821163314.9830-1-clark.williams@gmail.com> (raw)

From: Clark Williams <williams@redhat.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@redhat.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


                 reply	other threads:[~2019-08-21 16:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190821163314.9830-1-clark.williams@gmail.com \
    --to=clark.williams@gmail.com \
    --cc=bigeasy@linutronix.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vgr.kernel.org \
    --cc=tglx@linutronix.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®