diff options
author | Yinghai Lu <yinghai@kernel.org> | 2009-02-08 19:18:03 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-09 02:55:08 -0500 |
commit | 0f3c2a89c1451cdf6328f99977bd9decd4f708e1 (patch) | |
tree | 5f06396e409410e5d506f72fe6abebc376a5e689 | |
parent | 4d87c5bec5389625d80b71108795aecf82cd670d (diff) |
irq: clear kstat_irqs
Impact: get correct kstat_irqs [/proc/interrupts] for msi/msi-x etc
need to call clear_kstat_irqs(), so when we reuse that irq_desc,
we get correct kstat in /proc/interrupts.
This makes /proc/interrupts not have <NULL> entries.
Don't need to worry about arch that doesn't support genirq, because they
will not call dynamic_irq_cleanup().
v2: simplify and make clear_kstat_irqs more robust
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | kernel/irq/chip.c | 1 | ||||
-rw-r--r-- | kernel/irq/handle.c | 5 | ||||
-rw-r--r-- | kernel/irq/internals.h | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index f63c706d25e1..1310856cb22b 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -78,6 +78,7 @@ void dynamic_irq_cleanup(unsigned int irq) | |||
78 | desc->handle_irq = handle_bad_irq; | 78 | desc->handle_irq = handle_bad_irq; |
79 | desc->chip = &no_irq_chip; | 79 | desc->chip = &no_irq_chip; |
80 | desc->name = NULL; | 80 | desc->name = NULL; |
81 | clear_kstat_irqs(desc); | ||
81 | spin_unlock_irqrestore(&desc->lock, flags); | 82 | spin_unlock_irqrestore(&desc->lock, flags); |
82 | } | 83 | } |
83 | 84 | ||
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c index 48299a8a22f8..1b473e7569aa 100644 --- a/kernel/irq/handle.c +++ b/kernel/irq/handle.c | |||
@@ -242,6 +242,11 @@ struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu) | |||
242 | } | 242 | } |
243 | #endif /* !CONFIG_SPARSE_IRQ */ | 243 | #endif /* !CONFIG_SPARSE_IRQ */ |
244 | 244 | ||
245 | void clear_kstat_irqs(struct irq_desc *desc) | ||
246 | { | ||
247 | memset(desc->kstat_irqs, 0, nr_cpu_ids * sizeof(*(desc->kstat_irqs))); | ||
248 | } | ||
249 | |||
245 | /* | 250 | /* |
246 | * What should we do if we get a hw irq event on an illegal vector? | 251 | * What should we do if we get a hw irq event on an illegal vector? |
247 | * Each architecture has to answer this themself. | 252 | * Each architecture has to answer this themself. |
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h index e6d0a43cc125..b60950bf5a16 100644 --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h | |||
@@ -15,6 +15,7 @@ extern int __irq_set_trigger(struct irq_desc *desc, unsigned int irq, | |||
15 | 15 | ||
16 | extern struct lock_class_key irq_desc_lock_class; | 16 | extern struct lock_class_key irq_desc_lock_class; |
17 | extern void init_kstat_irqs(struct irq_desc *desc, int cpu, int nr); | 17 | extern void init_kstat_irqs(struct irq_desc *desc, int cpu, int nr); |
18 | extern void clear_kstat_irqs(struct irq_desc *desc); | ||
18 | extern spinlock_t sparse_irq_lock; | 19 | extern spinlock_t sparse_irq_lock; |
19 | extern struct irq_desc *irq_desc_ptrs[NR_IRQS]; | 20 | extern struct irq_desc *irq_desc_ptrs[NR_IRQS]; |
20 | 21 | ||