linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PREEMPT_RT] bogus lockdep assert from i915 on v5.2-rt1
@ 2019-07-16 19:50 Clark Williams
  2019-07-16 20:29 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Clark Williams @ 2019-07-16 19:50 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Sebastian Andrzej Siewior, RT, LKML

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

Thomas,

When looking at a problem on v5.2-rt1, I turned on lockdep and started getting warnings
from lockdep_assert_irqs_disabled() in the i915 driver. They're making these calls inside
a spin_lock_irqsave/spin_lock_irqrestore block, which of course doesn't fiddle with IRQs
when PREEMPT_RT is configured. The attached patch places the three calls inside
if (!IS_ENABLED(CONFIG_PREEMPT_RT_FULL)) blocks, so should avoid the bogus warning on RT.

Clark

-- 
The United States Coast Guard
Ruining Natural Selection since 1790

[-- Attachment #2: 0001-i915-avoid-calling-lockdep_assert_irqs_disabled-on-P.patch --]
[-- Type: text/x-patch, Size: 1950 bytes --]

From 8ed59c9195ce6fd338916b39155b738c557d0cab Mon Sep 17 00:00:00 2001
From: Clark Williams <williams@redhat.com>
Date: Sun, 14 Jul 2019 16:42:21 -0500
Subject: [PATCH 1/2] i915: avoid calling lockdep_assert_irqs_disabled on
 PREEMPT_RT_FULL

The PREEMPT_RT_FULL patchset keeps irqs enabled when operating on
spin_locks. Avoid this lockdep call on RT since in most cases it
will fail and WARN unnessesarily.

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

diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c
index 832cb6b1e9bd..3eef6010ebf6 100644
--- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
+++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
@@ -101,7 +101,8 @@ __dma_fence_signal__notify(struct dma_fence *fence)
 	struct dma_fence_cb *cur, *tmp;
 
 	lockdep_assert_held(fence->lock);
-	lockdep_assert_irqs_disabled();
+	if (!IS_ENABLED(CONFIG_PREEMPT_RT_FULL))
+		lockdep_assert_irqs_disabled();
 
 	list_for_each_entry_safe(cur, tmp, &fence->cb_list, node) {
 		INIT_LIST_HEAD(&cur->node);
@@ -276,7 +277,8 @@ void intel_engine_fini_breadcrumbs(struct intel_engine_cs *engine)
 bool i915_request_enable_breadcrumb(struct i915_request *rq)
 {
 	lockdep_assert_held(&rq->lock);
-	lockdep_assert_irqs_disabled();
+	if (!IS_ENABLED(CONFIG_PREEMPT_RT_FULL))
+		lockdep_assert_irqs_disabled();
 
 	if (test_bit(I915_FENCE_FLAG_ACTIVE, &rq->fence.flags)) {
 		struct intel_breadcrumbs *b = &rq->engine->breadcrumbs;
@@ -325,7 +327,8 @@ void i915_request_cancel_breadcrumb(struct i915_request *rq)
 	struct intel_breadcrumbs *b = &rq->engine->breadcrumbs;
 
 	lockdep_assert_held(&rq->lock);
-	lockdep_assert_irqs_disabled();
+	if (!IS_ENABLED(CONFIG_PREEMPT_RT_FULL))
+		lockdep_assert_irqs_disabled();
 
 	/*
 	 * We must wait for b->irq_lock so that we know the interrupt handler
-- 
2.21.0


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

end of thread, other threads:[~2019-07-16 20:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-16 19:50 [PREEMPT_RT] bogus lockdep assert from i915 on v5.2-rt1 Clark Williams
2019-07-16 20:29 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).