lkml.org 
[lkml]   [2019]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PREEMPT_RT] bogus lockdep assert from i915 on v5.2-rt1
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
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
\
 
 \ /
  Last update: 2019-07-16 21:51    [W:0.028 / U:0.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site