From ac84c974207dfc5769211cbf9b31a13353bedc2b Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 8 Mar 2003 03:28:10 -0800 Subject: [PATCH] [PATCH] protect 'action' in show_interrupts Patch from Zwane Mwaikambo On SMP or preemptible kernels, every instance of show_interrupts() is oopsily racy wrt request_irq() and free_irq(). Fix that up by taking the irq_desc_t's lock while walking the action list. --- arch/alpha/kernel/irq.c | 15 ++++++++++----- arch/arm/kernel/irq.c | 11 ++++++++--- arch/cris/kernel/irq.c | 6 +++++- arch/i386/kernel/irq.c | 7 ++++++- arch/ia64/kernel/irq.c | 8 ++++++-- arch/mips/baget/irq.c | 6 +++++- arch/mips/dec/irq.c | 6 +++++- arch/mips/ite-boards/generic/irq.c | 9 ++++++++- arch/mips/kernel/irq.c | 8 ++++++-- arch/mips/kernel/old-irq.c | 6 +++++- arch/mips/mips-boards/atlas/atlas_int.c | 7 ++++++- arch/mips/philips/nino/irq.c | 6 +++++- arch/mips64/mips-boards/atlas/atlas_int.c | 7 ++++++- arch/mips64/mips-boards/malta/malta_int.c | 11 +++++++++-- arch/mips64/sgi-ip22/ip22-int.c | 11 +++++++++-- arch/mips64/sgi-ip27/ip27-irq.c | 6 +++++- arch/ppc/kernel/irq.c | 8 ++++++-- arch/ppc64/kernel/irq.c | 6 +++++- arch/sh/kernel/irq.c | 8 ++++++-- arch/sparc/kernel/irq.c | 6 +++++- arch/v850/kernel/irq.c | 9 ++++++--- arch/x86_64/kernel/irq.c | 8 ++++++-- 22 files changed, 138 insertions(+), 37 deletions(-) diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c index b10ae89943dd0..b1480c1133714 100644 --- a/arch/alpha/kernel/irq.c +++ b/arch/alpha/kernel/irq.c @@ -515,6 +515,7 @@ show_interrupts(struct seq_file *p, void *v) #endif int i; struct irqaction * action; + unsigned long flags; #ifdef CONFIG_SMP seq_puts(p, " "); @@ -525,9 +526,10 @@ show_interrupts(struct seq_file *p, void *v) #endif for (i = 0; i < ACTUAL_NR_IRQS; i++) { + spin_lock_irqsave(&irq_desc[i].lock, flags); action = irq_desc[i].action; if (!action) - continue; + goto unlock; seq_printf(p, "%3d: ",i); #ifndef CONFIG_SMP seq_printf(p, "%10u ", kstat_irqs(i)); @@ -538,15 +540,18 @@ show_interrupts(struct seq_file *p, void *v) #endif seq_printf(p, " %14s", irq_desc[i].handler->typename); seq_printf(p, " %c%s", - (action->flags & SA_INTERRUPT)?'+':' ', - action->name); + (action->flags & SA_INTERRUPT)?'+':' ', + action->name); for (action=action->next; action; action = action->next) { seq_printf(p, ", %c%s", - (action->flags & SA_INTERRUPT)?'+':' ', - action->name); + (action->flags & SA_INTERRUPT)?'+':' ', + action->name); } + seq_putc(p, '\n'); +unlock: + spin_unlock_irqrestore(&irq_desc[i].lock, flags); } #if CONFIG_SMP seq_puts(p, "IPI: "); diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index 74f4c0bbc725f..2e937f85c2577 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c @@ -165,17 +165,22 @@ int show_interrupts(struct seq_file *p, void *v) { int i; struct irqaction * action; + unsigned long flags; for (i = 0 ; i < NR_IRQS ; i++) { + spin_lock_irqsave(&irq_controller_lock, flags); action = irq_desc[i].action; if (!action) - continue; + goto unlock; + seq_printf(p, "%3d: %10u ", i, kstat_irqs(i)); seq_printf(p, " %s", action->name); - for (action = action->next; action; action = action->next) { + for (action = action->next; action; action = action->next) seq_printf(p, ", %s", action->name); - } + seq_putc(p, '\n'); +unlock: + spin_unlock_irqrestore(&irq_controller_lock, flags); } #ifdef CONFIG_ARCH_ACORN diff --git a/arch/cris/kernel/irq.c b/arch/cris/kernel/irq.c index ad724fe737a1c..c63a5f02b00d7 100644 --- a/arch/cris/kernel/irq.c +++ b/arch/cris/kernel/irq.c @@ -228,11 +228,13 @@ int show_interrupts(struct seq_file *p, void *v) { int i; struct irqaction * action; + unsigned long flags; for (i = 0; i < NR_IRQS; i++) { + local_irq_save(flags); action = irq_action[i]; if (!action) - continue; + goto skip; seq_printf(p, "%2d: %10u %c %s", i, kstat_cpu(0).irqs[i], (action->flags & SA_INTERRUPT) ? '+' : ' ', @@ -243,6 +245,8 @@ int show_interrupts(struct seq_file *p, void *v) action->name); } seq_putc(p, '\n'); +skip: + local_irq_restore(flags); } return 0; } diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c index 6760e8f41aa36..9dc64227383e6 100644 --- a/arch/i386/kernel/irq.c +++ b/arch/i386/kernel/irq.c @@ -135,6 +135,7 @@ int show_interrupts(struct seq_file *p, void *v) { int i, j; struct irqaction * action; + unsigned long flags; seq_printf(p, " "); for (j=0; jnext; action; action = action->next) seq_printf(p, ", %s", action->name); + seq_putc(p, '\n'); +skip: + spin_unlock_irqrestore(&irq_desc[i].lock, flags); } seq_printf(p, "NMI: "); for (j = 0; j < NR_CPUS; j++) diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c index b614d7c986879..e3b06787a47ea 100644 --- a/arch/ia64/kernel/irq.c +++ b/arch/ia64/kernel/irq.c @@ -154,6 +154,7 @@ int show_interrupts(struct seq_file *p, void *v) int i, j; struct irqaction * action; irq_desc_t *idesc; + unsigned long flags; seq_puts(p, " "); for (j=0; jlock, flags); action = idesc->action; if (!action) - continue; + goto skip; seq_printf(p, "%3d: ",i); #ifndef CONFIG_SMP seq_printf(p, "%10u ", kstat_irqs(i)); @@ -176,10 +178,12 @@ int show_interrupts(struct seq_file *p, void *v) #endif seq_printf(p, " %14s", idesc->handler->typename); seq_printf(p, " %s", action->name); - for (action=action->next; action; action = action->next) seq_printf(p, ", %s", action->name); + seq_putc(p, '\n'); +skip: + spin_unlock_irqrestore(&idesc->lock, flags); } seq_puts(p, "NMI: "); for (j = 0; j < NR_CPUS; j++) diff --git a/arch/mips/baget/irq.c b/arch/mips/baget/irq.c index 9e7b33ae15a7f..0673af935cb1e 100644 --- a/arch/mips/baget/irq.c +++ b/arch/mips/baget/irq.c @@ -146,11 +146,13 @@ int show_interrupts(struct seq_file *p, void *v) { int i; struct irqaction * action; + unsigned long flags; for (i = 0 ; i < BAGET_IRQ_NR ; i++) { + local_irq_save(flags); action = irq_action[i]; if (!action) - continue; + goto skip; seq_printf(p, "%2d: %8d %c %s", i, kstat_cpu(0).irqs[i], (action->flags & SA_INTERRUPT) ? '+' : ' ', @@ -161,6 +163,8 @@ int show_interrupts(struct seq_file *p, void *v) action->name); } seq_putc(p, '\n'); +skip: + local_irq_restore(flags); } return 0; } diff --git a/arch/mips/dec/irq.c b/arch/mips/dec/irq.c index a256637191cb1..894241b6f6f8a 100644 --- a/arch/mips/dec/irq.c +++ b/arch/mips/dec/irq.c @@ -97,11 +97,13 @@ int show_interrupts(struct seq_file *p, void *v) { int i; struct irqaction *action; + unsigned long flags; for (i = 0; i < 32; i++) { + local_irq_save(flags); action = irq_action[i]; if (!action) - continue; + goto skip; seq_printf(p, "%2d: %8d %c %s", i, kstat_cpu(0).irqs[i], (action->flags & SA_INTERRUPT) ? '+' : ' ', @@ -112,6 +114,8 @@ int show_interrupts(struct seq_file *p, void *v) action->name); } seq_putc(p, '\n'); +skip: + local_irq_restore(flags); } return 0; } diff --git a/arch/mips/ite-boards/generic/irq.c b/arch/mips/ite-boards/generic/irq.c index 74298ffa826cd..3387434671893 100644 --- a/arch/mips/ite-boards/generic/irq.c +++ b/arch/mips/ite-boards/generic/irq.c @@ -222,6 +222,7 @@ int show_interrupts(struct seq_file *p, void *v) { int i, j; struct irqaction * action; + unsigned long flags; seq_printf(p, " "); for (j=0; jhandler ) - continue; + goto skip; seq_printf(p, "%3d: ", i); seq_printf(p, "%10u ", kstat_irqs(i)); if ( irq_desc[i].handler ) seq_printf(p, " %s ", irq_desc[i].handler->typename ); else seq_puts(p, " None "); + seq_printf(p, " %s",action->name); for (action=action->next; action; action = action->next) { seq_printf(p, ", %s", action->name); } seq_putc(p, '\n'); +skip: + spin_unlock_irqrestore(&irq_desc[i].lock, flags); } seq_printf(p, "BAD: %10lu\n", spurious_count); return 0; @@ -437,6 +443,7 @@ void __init init_IRQ(void) irq_desc[i].action = 0; irq_desc[i].depth = 1; irq_desc[i].handler = &it8172_irq_type; + spin_lock_init(&irq_desc[i].lock); } /* diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c index cf6fb793e8e0a..7f97250df1fd8 100644 --- a/arch/mips/kernel/irq.c +++ b/arch/mips/kernel/irq.c @@ -73,17 +73,19 @@ volatile unsigned long irq_err_count, spurious_count; int show_interrupts(struct seq_file *p, void *v) { struct irqaction * action; + unsigned long flags; int i; - + seq_puts(p, " "); for (i=0; i < 1 /*smp_num_cpus*/; i++) seq_printf(p, "CPU%d ", i); seq_putc(p, '\n'); for (i = 0 ; i < NR_IRQS ; i++) { + spin_lock_irqsave(&irq_desc[i].lock, flags); action = irq_desc[i].action; if (!action) - continue; + goto unlock; seq_printf(p, "%3d: ",i); seq_printf(p, "%10u ", kstat_irqs(i)); seq_printf(p, " %14s", irq_desc[i].handler->typename); @@ -92,6 +94,8 @@ int show_interrupts(struct seq_file *p, void *v) for (action=action->next; action; action = action->next) seq_printf(p, ", %s", action->name); seq_putc(p, '\n'); +unlock: + spin_unlock_irqrestore(&irq_desc[i].lock, flags); } seq_printf(p, "ERR: %10lu\n", irq_err_count); return 0; diff --git a/arch/mips/kernel/old-irq.c b/arch/mips/kernel/old-irq.c index 520caf6af0780..9dedb01a92e51 100644 --- a/arch/mips/kernel/old-irq.c +++ b/arch/mips/kernel/old-irq.c @@ -128,11 +128,13 @@ int show_interrupts(struct seq_file *p, void *v) { int i; struct irqaction * action; + unsigned long flags; for (i = 0 ; i < 32 ; i++) { + local_irq_save(flags); action = irq_action[i]; if (!action) - continue; + goto skip; seq_printf(p, "%2d: %8d %c %s", i, kstat_cpu(0).irqs[i], (action->flags & SA_INTERRUPT) ? '+' : ' ', @@ -143,6 +145,8 @@ int show_interrupts(struct seq_file *p, void *v) action->name); } seq_putc(p, '\n'); +skip: + local_irq_restore(flags); } return 0; } diff --git a/arch/mips/mips-boards/atlas/atlas_int.c b/arch/mips/mips-boards/atlas/atlas_int.c index b544f682df27f..62761d89c78ad 100644 --- a/arch/mips/mips-boards/atlas/atlas_int.c +++ b/arch/mips/mips-boards/atlas/atlas_int.c @@ -99,11 +99,13 @@ int show_interrupts(struct seq_file *p, void *v) int i; int num = 0; struct irqaction *action; + unsigned long flags; for (i = 0; i < ATLASINT_END; i++, num++) { + spin_lock_irqsave(&irq_desc[i].lock, flags); action = irq_desc[i].action; if (!action) - continue; + goto skip; seq_printf(p, "%2d: %8d %c %s", num, kstat_cpu(0).irqs[num], (action->flags & SA_INTERRUPT) ? '+' : ' ', @@ -114,6 +116,8 @@ int show_interrupts(struct seq_file *p, void *v) action->name); } seq_printf(p, " [hw0]\n"); +skip: + spin_unlock_irqrestore(&irq_desc[i].lock, flags); } return 0; } @@ -243,6 +247,7 @@ void __init init_IRQ(void) irq_desc[i].action = 0; irq_desc[i].depth = 1; irq_desc[i].handler = &atlas_irq_type; + spin_lock_init(&irq_desc[i].lock); } #ifdef CONFIG_REMOTE_DEBUG diff --git a/arch/mips/philips/nino/irq.c b/arch/mips/philips/nino/irq.c index 80c51c6e31569..acb0c5ceec7f4 100644 --- a/arch/mips/philips/nino/irq.c +++ b/arch/mips/philips/nino/irq.c @@ -119,11 +119,13 @@ int show_interrupts(struct seq_file *p, void *v) { int i; struct irqaction *action; + unsigned long flags; for (i = 0; i < NR_IRQS; i++) { + local_irq_save(flags); action = irq_action[i]; if (!action) - continue; + goto skip; seq_printf(p, "%2d: %8d %c %s", i, kstat_cpu(0).irqs[i], (action->flags & SA_INTERRUPT) ? '+' : ' ', @@ -134,6 +136,8 @@ int show_interrupts(struct seq_file *p, void *v) action->name); } seq_putc(p, '\n'); +skip: + local_irq_restore(flags); } return 0; } diff --git a/arch/mips64/mips-boards/atlas/atlas_int.c b/arch/mips64/mips-boards/atlas/atlas_int.c index 33e48b5c40c4c..291b38b768cac 100644 --- a/arch/mips64/mips-boards/atlas/atlas_int.c +++ b/arch/mips64/mips-boards/atlas/atlas_int.c @@ -95,11 +95,13 @@ int show_interrupts(struct seq_file *p, void *v) int i; int num = 0; struct irqaction *action; + unsigned long flags; for (i = 0; i < ATLASINT_END; i++, num++) { + spin_lock_irqsave(&irq_desc[i].lock, flags); action = irq_desc[i].action; if (!action) - continue; + goto unlock; seq_printf(p, "%2d: %8d %c %s", num, kstat_cpu(0).irqs[num], (action->flags & SA_INTERRUPT) ? '+' : ' ', @@ -110,6 +112,8 @@ int show_interrupts(struct seq_file *p, void *v) action->name); } seq_puts(p, " [hw0]\n"); +unlock: + spin_unlock_irqrestore(&irq_desc[i].lock, flags); } return 0; } @@ -239,6 +243,7 @@ void __init init_IRQ(void) irq_desc[i].action = 0; irq_desc[i].depth = 1; irq_desc[i].handler = &atlas_irq_type; + spin_lock_init(&irq_desc[i].lock); } #ifdef CONFIG_REMOTE_DEBUG diff --git a/arch/mips64/mips-boards/malta/malta_int.c b/arch/mips64/mips-boards/malta/malta_int.c index daafc16af6f6a..3a37f846e200d 100644 --- a/arch/mips64/mips-boards/malta/malta_int.c +++ b/arch/mips64/mips-boards/malta/malta_int.c @@ -125,11 +125,13 @@ int show_interrupts(struct seq_file *p, void *v) int i; int num = 0; struct irqaction *action; + unsigned long flags; for (i = 0; i < 8; i++, num++) { + local_irq_save(flags); action = irq_action[i]; if (!action) - continue; + goto skip_1; seq_printf(p, "%2d: %8d %c %s", num, kstat_cpu(0).irqs[num], (action->flags & SA_INTERRUPT) ? '+' : ' ', @@ -140,11 +142,14 @@ int show_interrupts(struct seq_file *p, void *v) action->name); } seq_puts(p, " [on-chip]\n"); +skip_1: + local_irq_restore(flags); } for (i = 0; i < MALTAINT_END; i++, num++) { + local_irq_save(flags); action = hw0_irq_action[i]; if (!action) - continue; + goto skip_2; seq_printf(p, "%2d: %8d %c %s", num, kstat_cpu(0).irqs[num], (action->flags & SA_INTERRUPT) ? '+' : ' ', @@ -155,6 +160,8 @@ int show_interrupts(struct seq_file *p, void *v) action->name); } seq_puts(p, " [hw0]\n"); +skip_2: + local_irq_restore(flags); } return 0; } diff --git a/arch/mips64/sgi-ip22/ip22-int.c b/arch/mips64/sgi-ip22/ip22-int.c index 316460cd43590..3816ee62ec116 100644 --- a/arch/mips64/sgi-ip22/ip22-int.c +++ b/arch/mips64/sgi-ip22/ip22-int.c @@ -237,11 +237,13 @@ int show_interrupts(struct seq_file *p, void *v) int i; int num = 0; struct irqaction * action; + unsigned long flags; for (i = 0 ; i < 16 ; i++, num++) { + local_irq_save(flags); action = irq_action[i]; if (!action) - continue; + goto skip_1; seq_printf(p, "%2d: %8d %c %s", num, kstat_cpu(0).irqs[num], (action->flags & SA_INTERRUPT) ? '+' : ' ', @@ -252,11 +254,14 @@ int show_interrupts(struct seq_file *p, void *v) action->name); } seq_puts(p, " [on-chip]\n"); +skip_1: + local_irq_restore(flags); } for (i = 0 ; i < 24 ; i++, num++) { + local_irq_save(flags); action = local_irq_action[i]; if (!action) - continue; + goto skip_2; seq_printf(p, "%2d: %8d %c %s", num, kstat_cpu(0).irqs[num], (action->flags & SA_INTERRUPT) ? '+' : ' ', @@ -267,6 +272,8 @@ int show_interrupts(struct seq_file *p, void *v) action->name); } seq_puts(p, " [local]\n"); +skip_2: + local_irq_restore(flags); } return 0; } diff --git a/arch/mips64/sgi-ip27/ip27-irq.c b/arch/mips64/sgi-ip27/ip27-irq.c index ccccd7ce1563b..0c57d299b00d1 100644 --- a/arch/mips64/sgi-ip27/ip27-irq.c +++ b/arch/mips64/sgi-ip27/ip27-irq.c @@ -141,11 +141,13 @@ int show_interrupts(struct seq_file *p, void *v) { int i; struct irqaction * action; + unsigned long flags; for (i = 0 ; i < NR_IRQS ; i++) { + local_irq_save(flags); action = irq_action[i]; if (!action) - continue; + goto skip; seq_printf(p, "%2d: %8d %c %s", i, kstat_cpu(0).irqs[i], (action->flags & SA_INTERRUPT) ? '+' : ' ', action->name); @@ -156,6 +158,8 @@ int show_interrupts(struct seq_file *p, void *v) action->name); } seq_putc(p, '\n'); +skip: + local_irq_restore(flags); } return 0; } diff --git a/arch/ppc/kernel/irq.c b/arch/ppc/kernel/irq.c index a2cddb7f1c605..f0130aa394212 100644 --- a/arch/ppc/kernel/irq.c +++ b/arch/ppc/kernel/irq.c @@ -346,6 +346,7 @@ int show_interrupts(struct seq_file *p, void *v) { int i, j; struct irqaction * action; + unsigned long flags; seq_puts(p, " "); for (j=0; jhandler ) - continue; + goto skip; seq_printf(p, "%3d: ", i); #ifdef CONFIG_SMP for (j = 0; j < NR_CPUS; j++) @@ -373,8 +375,10 @@ int show_interrupts(struct seq_file *p, void *v) seq_printf(p, "%s", (irq_desc[i].status & IRQ_LEVEL) ? "Level " : "Edge "); seq_printf(p, " %s", action->name); for (action = action->next; action; action = action->next) - seq_printf(p, ", %s", action->name); + seq_printf(p, ", %s", action->name); seq_putc(p, '\n'); +skip: + spin_unlock_irqrestore(&irq_desc[i].lock, flags); } #ifdef CONFIG_TAU_INT if (tau_initialized){ diff --git a/arch/ppc64/kernel/irq.c b/arch/ppc64/kernel/irq.c index 413f2a388784c..41cd99049cd3a 100644 --- a/arch/ppc64/kernel/irq.c +++ b/arch/ppc64/kernel/irq.c @@ -341,6 +341,7 @@ int show_interrupts(struct seq_file *p, void *v) { int i, j; struct irqaction * action; + unsigned long flags; seq_printf(p, " "); for (j=0; jhandler) - continue; + goto skip; seq_printf(p, "%3d: ", i); #ifdef CONFIG_SMP for (j = 0; j < NR_CPUS; j++) { @@ -371,6 +373,8 @@ int show_interrupts(struct seq_file *p, void *v) for (action=action->next; action; action = action->next) seq_printf(p, ", %s", action->name); seq_putc(p, '\n'); +skip: + spin_unlock_irqrestore(&irq_desc[i].lock, flags); } seq_printf(p, "BAD: %10u\n", ppc_spurious_interrupts); return 0; diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c index ce84bd4af2668..1376d5025080c 100644 --- a/arch/sh/kernel/irq.c +++ b/arch/sh/kernel/irq.c @@ -90,6 +90,7 @@ int show_interrupts(struct seq_file *p, void *v) { int i, j; struct irqaction * action; + unsigned long flags; seq_puts(p, " "); for (j=0; jtypename); @@ -108,6 +110,8 @@ int show_interrupts(struct seq_file *p, void *v) for (action=action->next; action; action = action->next) seq_printf(p, ", %s", action->name); seq_putc(p, '\n'); +unlock: + spin_unlock_irqrestore(&irq_desc[i].lock, flags); } return 0; } diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c index 9b73e08c0e2ac..311338e036448 100644 --- a/arch/sparc/kernel/irq.c +++ b/arch/sparc/kernel/irq.c @@ -104,6 +104,7 @@ int show_interrupts(struct seq_file *p, void *v) { int i; struct irqaction * action; + unsigned long flags; #ifdef CONFIG_SMP int j; #endif @@ -114,9 +115,10 @@ int show_interrupts(struct seq_file *p, void *v) return show_sun4d_interrupts(p, v); } for (i = 0 ; i < NR_IRQS ; i++) { + local_irq_save(flags); action = *(i + irq_action); if (!action) - continue; + goto skip; seq_printf(p, "%3d: ", i); #ifndef CONFIG_SMP seq_printf(p, "%10u ", kstat_irqs(i)); @@ -136,6 +138,8 @@ int show_interrupts(struct seq_file *p, void *v) action->name); } seq_putc(p, '\n'); +skip: + local_irq_restore(flags); } return 0; } diff --git a/arch/v850/kernel/irq.c b/arch/v850/kernel/irq.c index 7433c7f466530..05a893d3134d1 100644 --- a/arch/v850/kernel/irq.c +++ b/arch/v850/kernel/irq.c @@ -78,6 +78,7 @@ int show_interrupts(struct seq_file *p, void *v) { int i; struct irqaction * action; + unsigned long flags; seq_puts(p, " "); for (i=0; i < 1 /*smp_num_cpus*/; i++) @@ -87,10 +88,10 @@ int show_interrupts(struct seq_file *p, void *v) for (i = 0 ; i < NR_IRQS ; i++) { int j, count, num; const char *type_name = irq_desc[i].handler->typename; - + spin_lock_irqsave(&irq_desc[j].lock, flags); action = irq_desc[i].action; if (!action) - continue; + goto skip; count = 0; num = -1; @@ -108,11 +109,13 @@ int show_interrupts(struct seq_file *p, void *v) seq_printf(p, " %*s%d", 14 - prec, type_name, num); } else seq_printf(p, " %14s", type_name); + seq_printf(p, " %s", action->name); - for (action=action->next; action; action = action->next) seq_printf(p, ", %s", action->name); seq_putc(p, '\n'); +skip: + spin_unlock_irqrestore(&irq_desc[j].lock, flags); } seq_printf(p, "ERR: %10lu\n", irq_err_count); return 0; diff --git a/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c index a5c268e9ecc38..643020b794e03 100644 --- a/arch/x86_64/kernel/irq.c +++ b/arch/x86_64/kernel/irq.c @@ -135,6 +135,7 @@ int show_interrupts(struct seq_file *p, void *v) { int i, j; struct irqaction * action; + unsigned long flags; seq_printf(p, " "); for (j=0; jtypename); - seq_printf(p, " %s", action->name); + seq_printf(p, " %s", action->name); for (action=action->next; action; action = action->next) seq_printf(p, ", %s", action->name); seq_putc(p, '\n'); +skip: + spin_unlock_irqrestore(&irq_desc[i].lock, flags); } seq_printf(p, "NMI: "); for (j = 0; j < NR_CPUS; j++) -- 2.53.0