Commit 83d4e6e7 authored by Andreas Mohr's avatar Andreas Mohr Committed by Linus Torvalds

[PATCH] make noirqdebug/irqfixup __read_mostly, add (un)likely()

Signed-off-by: default avatarAndreas Mohr <andi@lisas.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e6022603
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
*/ */
#define MAX_IRQ_CNT 100000 #define MAX_IRQ_CNT 100000
static int noirqdebug; static int noirqdebug __read_mostly;
static volatile unsigned long irq_err_count; static volatile unsigned long irq_err_count;
static DEFINE_SPINLOCK(irq_controller_lock); static DEFINE_SPINLOCK(irq_controller_lock);
static LIST_HEAD(irq_pending); static LIST_HEAD(irq_pending);
...@@ -81,7 +81,7 @@ irqreturn_t no_action(int irq, void *dev_id, struct pt_regs *regs) ...@@ -81,7 +81,7 @@ irqreturn_t no_action(int irq, void *dev_id, struct pt_regs *regs)
void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
{ {
irq_err_count += 1; irq_err_count++;
printk(KERN_ERR "IRQ: spurious interrupt %d\n", irq); printk(KERN_ERR "IRQ: spurious interrupt %d\n", irq);
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <linux/kallsyms.h> #include <linux/kallsyms.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
static int irqfixup; static int irqfixup __read_mostly;
/* /*
* Recovery handler for misrouted interrupts. * Recovery handler for misrouted interrupts.
...@@ -136,9 +136,9 @@ static void report_bad_irq(unsigned int irq, irq_desc_t *desc, irqreturn_t actio ...@@ -136,9 +136,9 @@ static void report_bad_irq(unsigned int irq, irq_desc_t *desc, irqreturn_t actio
void note_interrupt(unsigned int irq, irq_desc_t *desc, irqreturn_t action_ret, void note_interrupt(unsigned int irq, irq_desc_t *desc, irqreturn_t action_ret,
struct pt_regs *regs) struct pt_regs *regs)
{ {
if (action_ret != IRQ_HANDLED) { if (unlikely(action_ret != IRQ_HANDLED)) {
desc->irqs_unhandled++; desc->irqs_unhandled++;
if (action_ret != IRQ_NONE) if (unlikely(action_ret != IRQ_NONE))
report_bad_irq(irq, desc, action_ret); report_bad_irq(irq, desc, action_ret);
} }
...@@ -152,11 +152,11 @@ void note_interrupt(unsigned int irq, irq_desc_t *desc, irqreturn_t action_ret, ...@@ -152,11 +152,11 @@ void note_interrupt(unsigned int irq, irq_desc_t *desc, irqreturn_t action_ret,
} }
desc->irq_count++; desc->irq_count++;
if (desc->irq_count < 100000) if (likely(desc->irq_count < 100000))
return; return;
desc->irq_count = 0; desc->irq_count = 0;
if (desc->irqs_unhandled > 99900) { if (unlikely(desc->irqs_unhandled > 99900)) {
/* /*
* The interrupt is stuck * The interrupt is stuck
*/ */
...@@ -171,7 +171,7 @@ void note_interrupt(unsigned int irq, irq_desc_t *desc, irqreturn_t action_ret, ...@@ -171,7 +171,7 @@ void note_interrupt(unsigned int irq, irq_desc_t *desc, irqreturn_t action_ret,
desc->irqs_unhandled = 0; desc->irqs_unhandled = 0;
} }
int noirqdebug; int noirqdebug __read_mostly;
int __init noirqdebug_setup(char *str) int __init noirqdebug_setup(char *str)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment