Skip to content

Commit

Permalink
drm/i915/gt: Only disable interrupts for the timeline lock on !force-…
Browse files Browse the repository at this point in the history
…threaded

According to commit
    d677392 ("drm/i915/gt: Mark up the nested engine-pm timeline lock as irqsafe")

the intrrupts are disabled the code may be called from an interrupt
handler and from preemptible context.
With `force_irqthreads' set the timeline mutex is never observed in IRQ
context so it is not neede to disable interrupts.

Disable only interrupts if not in `force_irqthreads' mode.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Sebastian Andrzej Siewior committed Sep 13, 2021
1 parent 530de1e commit e1628c2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/gpu/drm/i915/gt/intel_engine_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ static int __engine_unpark(struct intel_wakeref *wf)

static unsigned long __timeline_mark_lock(struct intel_context *ce)
{
unsigned long flags;
unsigned long flags = 0;

local_irq_save(flags);
if (!force_irqthreads())
local_irq_save(flags);
mutex_acquire(&ce->timeline->mutex.dep_map, 2, 0, _THIS_IP_);

return flags;
Expand All @@ -96,7 +97,8 @@ static void __timeline_mark_unlock(struct intel_context *ce,
unsigned long flags)
{
mutex_release(&ce->timeline->mutex.dep_map, _THIS_IP_);
local_irq_restore(flags);
if (!force_irqthreads())
local_irq_restore(flags);
}

#else
Expand Down

0 comments on commit e1628c2

Please sign in to comment.