| From 5b6c7b08196ea160f78a9afc1948091dc930b108 Mon Sep 17 00:00:00 2001 |
| From: Thomas Gleixner <tglx@linutronix.de> |
| Date: Mon, 17 May 2010 10:19:06 +0200 |
| Subject: [PATCH] net: Make [dis/en]able_irq_*_lockdep() RT safe |
| |
| commit 5b6c7b08196ea160f78a9afc1948091dc930b108 in tip. |
| |
| The lockdep irqoff protection which is used to prevent lockdep false |
| positives leads to "scheduling while atomic" and "might sleep" bug |
| floods. |
| |
| Make the irq disabling depend on !RT. |
| |
| Reported-by: Olaf Hering <olaf@aepfle.de> |
| Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
| |
| diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h |
| index 9f6580a..d363196 100644 |
| --- a/include/linux/interrupt.h |
| +++ b/include/linux/interrupt.h |
| @@ -246,7 +246,7 @@ static inline int irq_select_affinity(unsigned int irq) { return 0; } |
| 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 |
| } |
| @@ -254,7 +254,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 |
| } |
| @@ -262,14 +262,14 @@ static inline void disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned |
| static inline void disable_irq_lockdep(unsigned int irq) |
| { |
| disable_irq(irq); |
| -#ifdef CONFIG_LOCKDEP |
| +#if defined(CONFIG_LOCKDEP) && !defined(CONFIG_PREEMPT_RT) |
| local_irq_disable(); |
| #endif |
| } |
| |
| 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); |
| @@ -277,7 +277,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); |
| -- |
| 1.7.1.1 |
| |