lockdep: Don't disable interrupts on RT in disable_irq_nosync_lockdep.*()
[ Upstream commit87886b32d6] disable_irq_nosync_lockdep() disables interrupts with lockdep enabled to avoid false positive reports by lockdep that a certain lock has not been acquired with disabled interrupts. The user of this macros expects that a lock can be acquried without disabling interrupts because the IRQ line triggering the interrupt is disabled. This triggers a warning on PREEMPT_RT because after disable_irq_nosync_lockdep.*() the following spinlock_t now is acquired with disabled interrupts. On PREEMPT_RT there is no difference between spin_lock() and spin_lock_irq() so avoiding disabling interrupts in this case works for the two remaining callers as of today. Don't disable interrupts on PREEMPT_RT in disable_irq_nosync_lockdep.*(). Closes: https://lore.kernel.org/760e34f9-6034-40e0-82a5-ee9becd24438@roeck-us.net Fixes:e8106b941c("[PATCH] lockdep: core, add enable/disable_irq_irqsave/irqrestore() APIs") Reported-by: Guenter Roeck <linux@roeck-us.net> Suggested-by: "Steven Rostedt (Google)" <rostedt@goodmis.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20250212103619.2560503-2-bigeasy@linutronix.de Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
01c5ab2924
commit
477b6882f1
@@ -441,7 +441,7 @@ irq_calc_affinity_vectors(unsigned int minvec, unsigned int maxvec,
|
||||
static inline void disable_irq_nosync_lockdep(unsigned int irq)
|
||||
{
|
||||
disable_irq_nosync(irq);
|
||||
#ifdef CONFIG_LOCKDEP
|
||||
#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
|
||||
local_irq_disable();
|
||||
#endif
|
||||
}
|
||||
@@ -449,7 +449,7 @@ static inline void disable_irq_nosync_lockdep(unsigned int irq)
|
||||
static inline void disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned long *flags)
|
||||
{
|
||||
disable_irq_nosync(irq);
|
||||
#ifdef CONFIG_LOCKDEP
|
||||
#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
|
||||
local_irq_save(*flags);
|
||||
#endif
|
||||
}
|
||||
@@ -464,7 +464,7 @@ static inline void disable_irq_lockdep(unsigned int irq)
|
||||
|
||||
static inline void enable_irq_lockdep(unsigned int irq)
|
||||
{
|
||||
#ifdef CONFIG_LOCKDEP
|
||||
#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
|
||||
local_irq_enable();
|
||||
#endif
|
||||
enable_irq(irq);
|
||||
@@ -472,7 +472,7 @@ static inline void enable_irq_lockdep(unsigned int irq)
|
||||
|
||||
static inline void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long *flags)
|
||||
{
|
||||
#ifdef CONFIG_LOCKDEP
|
||||
#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT)
|
||||
local_irq_restore(*flags);
|
||||
#endif
|
||||
enable_irq(irq);
|
||||
|
||||
Reference in New Issue
Block a user