diff mbox series

[v2,6/8] drm/i915: Drop the irqs_disabled() check

Message ID 20240613102818.4056866-7-bigeasy@linutronix.de (mailing list archive)
State New, archived
Headers show
Series drm/i915: PREEMPT_RT related fixups. | expand

Commit Message

Sebastian Andrzej Siewior June 13, 2024, 10:20 a.m. UTC
The !irqs_disabled() check triggers on PREEMPT_RT even with
i915_sched_engine::lock acquired. The reason is the lock is transformed
into a sleeping lock on PREEMPT_RT and does not disable interrupts.

There is no need to check for disabled interrupts. The lockdep
annotation below already check if the lock has been acquired by the
caller and will yell if the interrupts are not disabled.

Remove the !irqs_disabled() check.

Reported-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/gpu/drm/i915/i915_request.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Tvrtko Ursulin June 19, 2024, 10:28 a.m. UTC | #1
On 13/06/2024 11:20, Sebastian Andrzej Siewior wrote:
> The !irqs_disabled() check triggers on PREEMPT_RT even with
> i915_sched_engine::lock acquired. The reason is the lock is transformed
> into a sleeping lock on PREEMPT_RT and does not disable interrupts.
> 
> There is no need to check for disabled interrupts. The lockdep
> annotation below already check if the lock has been acquired by the
> caller and will yell if the interrupts are not disabled.
> 
> Remove the !irqs_disabled() check.
> 
> Reported-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>   drivers/gpu/drm/i915/i915_request.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> index 519e096c607cd..466b5ee8ed6d2 100644
> --- a/drivers/gpu/drm/i915/i915_request.c
> +++ b/drivers/gpu/drm/i915/i915_request.c
> @@ -608,7 +608,6 @@ bool __i915_request_submit(struct i915_request *request)
>   
>   	RQ_TRACE(request, "\n");
>   
> -	GEM_BUG_ON(!irqs_disabled());
>   	lockdep_assert_held(&engine->sched_engine->lock);
>   
>   	/*
> @@ -717,7 +716,6 @@ void __i915_request_unsubmit(struct i915_request *request)
>   	 */
>   	RQ_TRACE(request, "\n");
>   
> -	GEM_BUG_ON(!irqs_disabled());
>   	lockdep_assert_held(&engine->sched_engine->lock);
>   
>   	/*

Maarten can you r-b since it seems this one originated from your 
testing? Otherwise:

Acked-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>

Regards,

Tvrtko
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 519e096c607cd..466b5ee8ed6d2 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -608,7 +608,6 @@  bool __i915_request_submit(struct i915_request *request)
 
 	RQ_TRACE(request, "\n");
 
-	GEM_BUG_ON(!irqs_disabled());
 	lockdep_assert_held(&engine->sched_engine->lock);
 
 	/*
@@ -717,7 +716,6 @@  void __i915_request_unsubmit(struct i915_request *request)
 	 */
 	RQ_TRACE(request, "\n");
 
-	GEM_BUG_ON(!irqs_disabled());
 	lockdep_assert_held(&engine->sched_engine->lock);
 
 	/*