Skip to content

Commit

Permalink
Merge branches 'irq/genirq', 'irq/sparseirq' and 'irq/urgent' into ir…
Browse files Browse the repository at this point in the history
…q/core
  • Loading branch information
Ingo Molnar committed Feb 13, 2009
4 parents 37bed90 + 0e43785 + 005bf0e + 548c893 commit 8f8573a
Show file tree
Hide file tree
Showing 33 changed files with 97 additions and 70 deletions.
2 changes: 1 addition & 1 deletion arch/alpha/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ show_interrupts(struct seq_file *p, void *v)
seq_printf(p, "%10u ", kstat_irqs(irq));
#else
for_each_online_cpu(j)
seq_printf(p, "%10u ", kstat_cpu(j).irqs[irq]);
seq_printf(p, "%10u ", kstat_irqs_cpu(irq, j));
#endif
seq_printf(p, " %14s", irq_desc[irq].chip->typename);
seq_printf(p, " %c%s",
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/irq_alpha.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ do_entInt(unsigned long type, unsigned long vector,
smp_percpu_timer_interrupt(regs);
cpu = smp_processor_id();
if (cpu != boot_cpuid) {
kstat_cpu(cpu).irqs[RTC_IRQ]++;
kstat_incr_irqs_this_cpu(RTC_IRQ, irq_to_desc(RTC_IRQ));
} else {
handle_irq(RTC_IRQ);
}
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int show_interrupts(struct seq_file *p, void *v)

seq_printf(p, "%3d: ", i);
for_each_present_cpu(cpu)
seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[i]);
seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu));
seq_printf(p, " %10s", irq_desc[i].chip->name ? : "-");
seq_printf(p, " %s", action->name);
for (action = action->next; action; action = action->next)
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-ns9xxx/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ static struct irq_chip ns9xxx_chip = {
#else
static void handle_prio_irq(unsigned int irq, struct irq_desc *desc)
{
unsigned int cpu = smp_processor_id();
struct irqaction *action;
irqreturn_t action_ret;

Expand All @@ -72,7 +71,7 @@ static void handle_prio_irq(unsigned int irq, struct irq_desc *desc)
BUG_ON(desc->status & IRQ_INPROGRESS);

desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
kstat_cpu(cpu).irqs[irq]++;
kstat_incr_irqs_this_cpu(irq, desc);

action = desc->action;
if (unlikely(!action || (desc->status & IRQ_DISABLED)))
Expand Down
2 changes: 1 addition & 1 deletion arch/avr32/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int show_interrupts(struct seq_file *p, void *v)

seq_printf(p, "%3d: ", i);
for_each_online_cpu(cpu)
seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[i]);
seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu));
seq_printf(p, " %8s", irq_desc[i].chip->name ? : "-");
seq_printf(p, " %s", action->name);
for (action = action->next; action; action = action->next)
Expand Down
2 changes: 1 addition & 1 deletion arch/blackfin/kernel/irqchip.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ int show_interrupts(struct seq_file *p, void *v)
goto skip;
seq_printf(p, "%3d: ", i);
for_each_online_cpu(j)
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
seq_printf(p, " %8s", irq_desc[i].chip->name);
seq_printf(p, " %s", action->name);
for (action = action->next; action; action = action->next)
Expand Down
2 changes: 1 addition & 1 deletion arch/cris/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int show_interrupts(struct seq_file *p, void *v)
seq_printf(p, "%10u ", kstat_irqs(i));
#else
for_each_online_cpu(j)
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
#endif
seq_printf(p, " %14s", irq_desc[i].chip->typename);
seq_printf(p, " %s", action->name);
Expand Down
2 changes: 1 addition & 1 deletion arch/frv/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int show_interrupts(struct seq_file *p, void *v)
if (action) {
seq_printf(p, "%3d: ", i);
for_each_present_cpu(cpu)
seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[i]);
seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu));
seq_printf(p, " %10s", irq_desc[i].chip->name ? : "-");
seq_printf(p, " %s", action->name);
for (action = action->next;
Expand Down
4 changes: 2 additions & 2 deletions arch/h8300/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ asmlinkage void do_IRQ(int irq)
#if defined(CONFIG_PROC_FS)
int show_interrupts(struct seq_file *p, void *v)
{
int i = *(loff_t *) v, j;
int i = *(loff_t *) v;
struct irqaction * action;
unsigned long flags;

Expand All @@ -196,7 +196,7 @@ int show_interrupts(struct seq_file *p, void *v)
if (!action)
goto unlock;
seq_printf(p, "%3d: ",i);
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
seq_printf(p, "%10u ", kstat_irqs(i));
seq_printf(p, " %14s", irq_desc[i].chip->name);
seq_printf(p, "-%-8s", irq_desc[i].name);
seq_printf(p, " %s", action->name);
Expand Down
2 changes: 1 addition & 1 deletion arch/ia64/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ int show_interrupts(struct seq_file *p, void *v)
seq_printf(p, "%10u ", kstat_irqs(i));
#else
for_each_online_cpu(j) {
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
}
#endif
seq_printf(p, " %14s", irq_desc[i].chip->name);
Expand Down
2 changes: 1 addition & 1 deletion arch/m32r/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int show_interrupts(struct seq_file *p, void *v)
seq_printf(p, "%10u ", kstat_irqs(i));
#else
for_each_online_cpu(j)
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
#endif
seq_printf(p, " %14s", irq_desc[i].chip->typename);
seq_printf(p, " %s", action->name);
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ int show_interrupts(struct seq_file *p, void *v)
seq_printf(p, "%10u ", kstat_irqs(i));
#else
for_each_online_cpu(j)
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
#endif
seq_printf(p, " %14s", irq_desc[i].chip->name);
seq_printf(p, "-%-8s", irq_desc[i].name);
Expand Down
2 changes: 1 addition & 1 deletion arch/mn10300/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ int show_interrupts(struct seq_file *p, void *v)
if (action) {
seq_printf(p, "%3d: ", i);
for_each_present_cpu(cpu)
seq_printf(p, "%10u ", kstat_cpu(cpu).irqs[i]);
seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu));
seq_printf(p, " %14s.%u", irq_desc[i].chip->name,
(GxICR(i) & GxICR_LEVEL) >>
GxICR_LEVEL_SHIFT);
Expand Down
2 changes: 1 addition & 1 deletion arch/parisc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ int show_interrupts(struct seq_file *p, void *v)
seq_printf(p, "%3d: ", i);
#ifdef CONFIG_SMP
for_each_online_cpu(j)
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
#else
seq_printf(p, "%10u ", kstat_irqs(i));
#endif
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ int show_interrupts(struct seq_file *p, void *v)
seq_printf(p, "%3d: ", i);
#ifdef CONFIG_SMP
for_each_online_cpu(j)
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
#else
seq_printf(p, "%10u ", kstat_irqs(i));
#endif /* CONFIG_SMP */
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/cell/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ static void handle_iic_irq(unsigned int irq, struct irq_desc *desc)
goto out_eoi;
}

kstat_cpu(cpu).irqs[irq]++;
kstat_incr_irqs_this_cpu(irq, desc);

/* Mark the IRQ currently in progress.*/
desc->status |= IRQ_INPROGRESS;
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int show_interrupts(struct seq_file *p, void *v)
goto unlock;
seq_printf(p, "%3d: ",i);
for_each_online_cpu(j)
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
seq_printf(p, " %14s", irq_desc[i].chip->name);
seq_printf(p, "-%-8s", irq_desc[i].name);
seq_printf(p, " %s", action->name);
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/irq_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ int show_interrupts(struct seq_file *p, void *v)
seq_printf(p, "%10u ", kstat_irqs(i));
#else
for_each_online_cpu(j)
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
#endif
seq_printf(p, " %9s", irq_desc[i].chip->typename);
seq_printf(p, " %s", action->name);
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/time_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
#include <linux/clocksource.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/irq.h>

#include <asm/oplib.h>
#include <asm/timer.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/starfire.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/um/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int show_interrupts(struct seq_file *p, void *v)
seq_printf(p, "%10u ", kstat_irqs(i));
#else
for_each_online_cpu(j)
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
#endif
seq_printf(p, " %14s", irq_desc[i].chip->typename);
seq_printf(p, " %s", action->name);
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ int show_interrupts(struct seq_file *p, void *v)
seq_printf(p, "%10u ", kstat_irqs(i));
#else
for_each_online_cpu(j)
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
#endif
seq_printf(p, " %14s", irq_desc[i].chip->typename);
seq_printf(p, " %s", action->name);
Expand Down
6 changes: 5 additions & 1 deletion drivers/char/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@
#include <linux/percpu.h>
#include <linux/cryptohash.h>

#ifdef CONFIG_GENERIC_HARDIRQS
# include <linux/irq.h>
#endif

#include <asm/processor.h>
#include <asm/uaccess.h>
#include <asm/irq.h>
Expand Down Expand Up @@ -558,7 +562,7 @@ struct timer_rand_state {
unsigned dont_count_entropy:1;
};

#ifndef CONFIG_SPARSE_IRQ
#ifndef CONFIG_GENERIC_HARDIRQS

static struct timer_rand_state *irq_timer_state[NR_IRQS];

Expand Down
2 changes: 1 addition & 1 deletion drivers/pci/intr_remapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct irq_2_iommu {
u8 irte_mask;
};

#ifdef CONFIG_SPARSE_IRQ
#ifdef CONFIG_GENERIC_HARDIRQS
static struct irq_2_iommu *get_one_free_irq_2_iommu(int cpu)
{
struct irq_2_iommu *iommu;
Expand Down
6 changes: 6 additions & 0 deletions include/linux/interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,12 @@ static inline void init_irq_proc(void)
}
#endif

#if defined(CONFIG_GENERIC_HARDIRQS) && defined(CONFIG_DEBUG_SHIRQ)
extern void debug_poll_all_shared_irqs(void);
#else
static inline void debug_poll_all_shared_irqs(void) { }
#endif

int show_interrupts(struct seq_file *p, void *v);

struct irq_desc;
Expand Down
10 changes: 1 addition & 9 deletions include/linux/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,10 @@ struct irq_2_iommu;
*/
struct irq_desc {
unsigned int irq;
#ifdef CONFIG_SPARSE_IRQ
struct timer_rand_state *timer_rand_state;
unsigned int *kstat_irqs;
# ifdef CONFIG_INTR_REMAP
#ifdef CONFIG_INTR_REMAP
struct irq_2_iommu *irq_2_iommu;
# endif
#endif
irq_flow_handler_t handle_irq;
struct irq_chip *chip;
Expand Down Expand Up @@ -202,12 +200,6 @@ extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc
extern struct irq_desc irq_desc[NR_IRQS];
#else /* CONFIG_SPARSE_IRQ */
extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu);

#define kstat_irqs_this_cpu(DESC) \
((DESC)->kstat_irqs[smp_processor_id()])
#define kstat_incr_irqs_this_cpu(irqno, DESC) \
((DESC)->kstat_irqs[smp_processor_id()]++)

#endif /* CONFIG_SPARSE_IRQ */

extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu);
Expand Down
8 changes: 6 additions & 2 deletions include/linux/irqnr.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ extern struct irq_desc *irq_to_desc(unsigned int irq);
# define for_each_irq_desc(irq, desc) \
for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; \
irq++, desc = irq_to_desc(irq)) \
if (desc)
if (!desc) \
; \
else


# define for_each_irq_desc_reverse(irq, desc) \
for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; \
irq--, desc = irq_to_desc(irq)) \
if (desc)
if (!desc) \
; \
else

#endif /* CONFIG_GENERIC_HARDIRQS */

Expand Down
13 changes: 8 additions & 5 deletions include/linux/kernel_stat.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct cpu_usage_stat {

struct kernel_stat {
struct cpu_usage_stat cpustat;
#ifndef CONFIG_SPARSE_IRQ
#ifndef CONFIG_GENERIC_HARDIRQS
unsigned int irqs[NR_IRQS];
#endif
};
Expand All @@ -41,7 +41,7 @@ DECLARE_PER_CPU(struct kernel_stat, kstat);

extern unsigned long long nr_context_switches(void);

#ifndef CONFIG_SPARSE_IRQ
#ifndef CONFIG_GENERIC_HARDIRQS
#define kstat_irqs_this_cpu(irq) \
(kstat_this_cpu.irqs[irq])

Expand All @@ -52,16 +52,19 @@ static inline void kstat_incr_irqs_this_cpu(unsigned int irq,
{
kstat_this_cpu.irqs[irq]++;
}
#endif


#ifndef CONFIG_SPARSE_IRQ
static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
{
return kstat_cpu(cpu).irqs[irq];
}
#else
#include <linux/irq.h>
extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu);
#define kstat_irqs_this_cpu(DESC) \
((DESC)->kstat_irqs[smp_processor_id()])
#define kstat_incr_irqs_this_cpu(irqno, DESC) \
((DESC)->kstat_irqs[smp_processor_id()]++)

#endif

/*
Expand Down
7 changes: 5 additions & 2 deletions kernel/irq/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ void dynamic_irq_cleanup(unsigned int irq)
desc->handle_irq = handle_bad_irq;
desc->chip = &no_irq_chip;
desc->name = NULL;
clear_kstat_irqs(desc);
spin_unlock_irqrestore(&desc->lock, flags);
}

Expand Down Expand Up @@ -290,7 +291,8 @@ static inline void mask_ack_irq(struct irq_desc *desc, int irq)
desc->chip->mask_ack(irq);
else {
desc->chip->mask(irq);
desc->chip->ack(irq);
if (desc->chip->ack)
desc->chip->ack(irq);
}
}

Expand Down Expand Up @@ -476,7 +478,8 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
kstat_incr_irqs_this_cpu(irq, desc);

/* Start handling the irq */
desc->chip->ack(irq);
if (desc->chip->ack)
desc->chip->ack(irq);
desc = irq_remap_to_desc(irq, desc);

/* Mark the IRQ currently in progress.*/
Expand Down
Loading

0 comments on commit 8f8573a

Please sign in to comment.