diff options
Diffstat (limited to 'kernel/irq/spurious.c')
| -rw-r--r-- | kernel/irq/spurious.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c index bd7273e6282e..89fb90ae534f 100644 --- a/kernel/irq/spurious.c +++ b/kernel/irq/spurious.c | |||
| @@ -28,7 +28,7 @@ static int try_one_irq(int irq, struct irq_desc *desc) | |||
| 28 | struct irqaction *action; | 28 | struct irqaction *action; |
| 29 | int ok = 0, work = 0; | 29 | int ok = 0, work = 0; |
| 30 | 30 | ||
| 31 | spin_lock(&desc->lock); | 31 | raw_spin_lock(&desc->lock); |
| 32 | /* Already running on another processor */ | 32 | /* Already running on another processor */ |
| 33 | if (desc->status & IRQ_INPROGRESS) { | 33 | if (desc->status & IRQ_INPROGRESS) { |
| 34 | /* | 34 | /* |
| @@ -37,13 +37,13 @@ static int try_one_irq(int irq, struct irq_desc *desc) | |||
| 37 | */ | 37 | */ |
| 38 | if (desc->action && (desc->action->flags & IRQF_SHARED)) | 38 | if (desc->action && (desc->action->flags & IRQF_SHARED)) |
| 39 | desc->status |= IRQ_PENDING; | 39 | desc->status |= IRQ_PENDING; |
| 40 | spin_unlock(&desc->lock); | 40 | raw_spin_unlock(&desc->lock); |
| 41 | return ok; | 41 | return ok; |
| 42 | } | 42 | } |
| 43 | /* Honour the normal IRQ locking */ | 43 | /* Honour the normal IRQ locking */ |
| 44 | desc->status |= IRQ_INPROGRESS; | 44 | desc->status |= IRQ_INPROGRESS; |
| 45 | action = desc->action; | 45 | action = desc->action; |
| 46 | spin_unlock(&desc->lock); | 46 | raw_spin_unlock(&desc->lock); |
| 47 | 47 | ||
| 48 | while (action) { | 48 | while (action) { |
| 49 | /* Only shared IRQ handlers are safe to call */ | 49 | /* Only shared IRQ handlers are safe to call */ |
| @@ -56,7 +56,7 @@ static int try_one_irq(int irq, struct irq_desc *desc) | |||
| 56 | } | 56 | } |
| 57 | local_irq_disable(); | 57 | local_irq_disable(); |
| 58 | /* Now clean up the flags */ | 58 | /* Now clean up the flags */ |
| 59 | spin_lock(&desc->lock); | 59 | raw_spin_lock(&desc->lock); |
| 60 | action = desc->action; | 60 | action = desc->action; |
| 61 | 61 | ||
| 62 | /* | 62 | /* |
| @@ -68,9 +68,9 @@ static int try_one_irq(int irq, struct irq_desc *desc) | |||
| 68 | * Perform real IRQ processing for the IRQ we deferred | 68 | * Perform real IRQ processing for the IRQ we deferred |
| 69 | */ | 69 | */ |
| 70 | work = 1; | 70 | work = 1; |
| 71 | spin_unlock(&desc->lock); | 71 | raw_spin_unlock(&desc->lock); |
| 72 | handle_IRQ_event(irq, action); | 72 | handle_IRQ_event(irq, action); |
| 73 | spin_lock(&desc->lock); | 73 | raw_spin_lock(&desc->lock); |
| 74 | desc->status &= ~IRQ_PENDING; | 74 | desc->status &= ~IRQ_PENDING; |
| 75 | } | 75 | } |
| 76 | desc->status &= ~IRQ_INPROGRESS; | 76 | desc->status &= ~IRQ_INPROGRESS; |
| @@ -80,7 +80,7 @@ static int try_one_irq(int irq, struct irq_desc *desc) | |||
| 80 | */ | 80 | */ |
| 81 | if (work && desc->chip && desc->chip->end) | 81 | if (work && desc->chip && desc->chip->end) |
| 82 | desc->chip->end(irq); | 82 | desc->chip->end(irq); |
| 83 | spin_unlock(&desc->lock); | 83 | raw_spin_unlock(&desc->lock); |
| 84 | 84 | ||
| 85 | return ok; | 85 | return ok; |
| 86 | } | 86 | } |
| @@ -104,7 +104,7 @@ static int misrouted_irq(int irq) | |||
| 104 | return ok; | 104 | return ok; |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | static void poll_all_shared_irqs(void) | 107 | static void poll_spurious_irqs(unsigned long dummy) |
| 108 | { | 108 | { |
| 109 | struct irq_desc *desc; | 109 | struct irq_desc *desc; |
| 110 | int i; | 110 | int i; |
| @@ -125,23 +125,11 @@ static void poll_all_shared_irqs(void) | |||
| 125 | try_one_irq(i, desc); | 125 | try_one_irq(i, desc); |
| 126 | local_irq_enable(); | 126 | local_irq_enable(); |
| 127 | } | 127 | } |
| 128 | } | ||
| 129 | |||
| 130 | static void poll_spurious_irqs(unsigned long dummy) | ||
| 131 | { | ||
| 132 | poll_all_shared_irqs(); | ||
| 133 | 128 | ||
| 134 | mod_timer(&poll_spurious_irq_timer, | 129 | mod_timer(&poll_spurious_irq_timer, |
| 135 | jiffies + POLL_SPURIOUS_IRQ_INTERVAL); | 130 | jiffies + POLL_SPURIOUS_IRQ_INTERVAL); |
| 136 | } | 131 | } |
| 137 | 132 | ||
| 138 | #ifdef CONFIG_DEBUG_SHIRQ | ||
| 139 | void debug_poll_all_shared_irqs(void) | ||
| 140 | { | ||
| 141 | poll_all_shared_irqs(); | ||
| 142 | } | ||
| 143 | #endif | ||
| 144 | |||
| 145 | /* | 133 | /* |
| 146 | * If 99,900 of the previous 100,000 interrupts have not been handled | 134 | * If 99,900 of the previous 100,000 interrupts have not been handled |
| 147 | * then assume that the IRQ is stuck in some manner. Drop a diagnostic | 135 | * then assume that the IRQ is stuck in some manner. Drop a diagnostic |
| @@ -232,7 +220,7 @@ void note_interrupt(unsigned int irq, struct irq_desc *desc, | |||
| 232 | /* | 220 | /* |
| 233 | * If we are seeing only the odd spurious IRQ caused by | 221 | * If we are seeing only the odd spurious IRQ caused by |
| 234 | * bus asynchronicity then don't eventually trigger an error, | 222 | * bus asynchronicity then don't eventually trigger an error, |
| 235 | * otherwise the couter becomes a doomsday timer for otherwise | 223 | * otherwise the counter becomes a doomsday timer for otherwise |
| 236 | * working systems | 224 | * working systems |
| 237 | */ | 225 | */ |
| 238 | if (time_after(jiffies, desc->last_unhandled + HZ/10)) | 226 | if (time_after(jiffies, desc->last_unhandled + HZ/10)) |
