Skip to content

Commit

Permalink
genirq: Convert irq_desc.lock to raw_spinlock
Browse files Browse the repository at this point in the history
Convert locks which cannot be sleeping locks in preempt-rt to
raw_spinlocks.

Signed-off-by: Thomas Gleixner <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Acked-by: Ingo Molnar <[email protected]>
  • Loading branch information
KAGA-KOKO committed Dec 14, 2009
1 parent 9f5a562 commit 239007b
Show file tree
Hide file tree
Showing 43 changed files with 240 additions and 240 deletions.
4 changes: 2 additions & 2 deletions arch/alpha/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ show_interrupts(struct seq_file *p, void *v)
#endif

if (irq < ACTUAL_NR_IRQS) {
spin_lock_irqsave(&irq_desc[irq].lock, flags);
raw_spin_lock_irqsave(&irq_desc[irq].lock, flags);
action = irq_desc[irq].action;
if (!action)
goto unlock;
Expand All @@ -105,7 +105,7 @@ show_interrupts(struct seq_file *p, void *v)

seq_putc(p, '\n');
unlock:
spin_unlock_irqrestore(&irq_desc[irq].lock, flags);
raw_spin_unlock_irqrestore(&irq_desc[irq].lock, flags);
} else if (irq == ACTUAL_NR_IRQS) {
#ifdef CONFIG_SMP
seq_puts(p, "IPI: ");
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/include/asm/mach/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ extern int show_fiq_list(struct seq_file *, void *);
*/
#define do_bad_IRQ(irq,desc) \
do { \
spin_lock(&desc->lock); \
raw_spin_lock(&desc->lock); \
handle_bad_irq(irq, desc); \
spin_unlock(&desc->lock); \
raw_spin_unlock(&desc->lock); \
} while(0)

#endif
12 changes: 6 additions & 6 deletions arch/arm/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ int show_interrupts(struct seq_file *p, void *v)
}

if (i < NR_IRQS) {
spin_lock_irqsave(&irq_desc[i].lock, flags);
raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
action = irq_desc[i].action;
if (!action)
goto unlock;
Expand All @@ -84,7 +84,7 @@ int show_interrupts(struct seq_file *p, void *v)

seq_putc(p, '\n');
unlock:
spin_unlock_irqrestore(&irq_desc[i].lock, flags);
raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
} else if (i == NR_IRQS) {
#ifdef CONFIG_FIQ
show_fiq_list(p, v);
Expand Down Expand Up @@ -139,15 +139,15 @@ void set_irq_flags(unsigned int irq, unsigned int iflags)
}

desc = irq_desc + irq;
spin_lock_irqsave(&desc->lock, flags);
raw_spin_lock_irqsave(&desc->lock, flags);
desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
if (iflags & IRQF_VALID)
desc->status &= ~IRQ_NOREQUEST;
if (iflags & IRQF_PROBE)
desc->status &= ~IRQ_NOPROBE;
if (!(iflags & IRQF_NOAUTOEN))
desc->status &= ~IRQ_NOAUTOEN;
spin_unlock_irqrestore(&desc->lock, flags);
raw_spin_unlock_irqrestore(&desc->lock, flags);
}

void __init init_IRQ(void)
Expand All @@ -166,9 +166,9 @@ static void route_irq(struct irq_desc *desc, unsigned int irq, unsigned int cpu)
{
pr_debug("IRQ%u: moving from cpu%u to cpu%u\n", irq, desc->node, cpu);

spin_lock_irq(&desc->lock);
raw_spin_lock_irq(&desc->lock);
desc->chip->set_affinity(irq, cpumask_of(cpu));
spin_unlock_irq(&desc->lock);
raw_spin_unlock_irq(&desc->lock);
}

/*
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mach-ns9xxx/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static void handle_prio_irq(unsigned int irq, struct irq_desc *desc)
struct irqaction *action;
irqreturn_t action_ret;

spin_lock(&desc->lock);
raw_spin_lock(&desc->lock);

BUG_ON(desc->status & IRQ_INPROGRESS);

Expand All @@ -78,7 +78,7 @@ static void handle_prio_irq(unsigned int irq, struct irq_desc *desc)
goto out_mask;

desc->status |= IRQ_INPROGRESS;
spin_unlock(&desc->lock);
raw_spin_unlock(&desc->lock);

action_ret = handle_IRQ_event(irq, action);

Expand All @@ -87,7 +87,7 @@ static void handle_prio_irq(unsigned int irq, struct irq_desc *desc)
* Maybe this function should go to kernel/irq/chip.c? */
note_interrupt(irq, desc, action_ret);

spin_lock(&desc->lock);
raw_spin_lock(&desc->lock);
desc->status &= ~IRQ_INPROGRESS;

if (desc->status & IRQ_DISABLED)
Expand All @@ -97,7 +97,7 @@ static void handle_prio_irq(unsigned int irq, struct irq_desc *desc)
/* ack unconditionally to unmask lower prio irqs */
desc->chip->ack(irq);

spin_unlock(&desc->lock);
raw_spin_unlock(&desc->lock);
}
#define handle_irq handle_prio_irq
#endif
Expand Down
4 changes: 2 additions & 2 deletions arch/avr32/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)
}

if (i < NR_IRQS) {
spin_lock_irqsave(&irq_desc[i].lock, flags);
raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
action = irq_desc[i].action;
if (!action)
goto unlock;
Expand All @@ -66,7 +66,7 @@ int show_interrupts(struct seq_file *p, void *v)

seq_putc(p, '\n');
unlock:
spin_unlock_irqrestore(&irq_desc[i].lock, flags);
raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
}

return 0;
Expand Down
6 changes: 3 additions & 3 deletions arch/blackfin/kernel/irqchip.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void ack_bad_irq(unsigned int irq)

static struct irq_desc bad_irq_desc = {
.handle_irq = handle_bad_irq,
.lock = __SPIN_LOCK_UNLOCKED(irq_desc->lock),
.lock = __RAW_SPIN_LOCK_UNLOCKED(bad_irq_desc.lock),
};

#ifdef CONFIG_CPUMASK_OFFSTACK
Expand All @@ -39,7 +39,7 @@ int show_interrupts(struct seq_file *p, void *v)
unsigned long flags;

if (i < NR_IRQS) {
spin_lock_irqsave(&irq_desc[i].lock, flags);
raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
action = irq_desc[i].action;
if (!action)
goto skip;
Expand All @@ -53,7 +53,7 @@ int show_interrupts(struct seq_file *p, void *v)

seq_putc(p, '\n');
skip:
spin_unlock_irqrestore(&irq_desc[i].lock, flags);
raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
} else if (i == NR_IRQS) {
seq_printf(p, "NMI: ");
for_each_online_cpu(j)
Expand Down
4 changes: 2 additions & 2 deletions arch/blackfin/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ void show_regs(struct pt_regs *fp)
if (fp->ipend & ~0x3F) {
for (i = 0; i < (NR_IRQS - 1); i++) {
if (!in_atomic)
spin_lock_irqsave(&irq_desc[i].lock, flags);
raw_spin_lock_irqsave(&irq_desc[i].lock, flags);

action = irq_desc[i].action;
if (!action)
Expand All @@ -1155,7 +1155,7 @@ void show_regs(struct pt_regs *fp)
verbose_printk("\n");
unlock:
if (!in_atomic)
spin_unlock_irqrestore(&irq_desc[i].lock, flags);
raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
}
}

Expand Down
4 changes: 2 additions & 2 deletions arch/cris/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int show_interrupts(struct seq_file *p, void *v)
}

if (i < NR_IRQS) {
spin_lock_irqsave(&irq_desc[i].lock, flags);
raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
action = irq_desc[i].action;
if (!action)
goto skip;
Expand All @@ -71,7 +71,7 @@ int show_interrupts(struct seq_file *p, void *v)

seq_putc(p, '\n');
skip:
spin_unlock_irqrestore(&irq_desc[i].lock, flags);
raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
}
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions arch/frv/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ int show_interrupts(struct seq_file *p, void *v)
}

if (i < NR_IRQS) {
spin_lock_irqsave(&irq_desc[i].lock, flags);
raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
action = irq_desc[i].action;
if (action) {
seq_printf(p, "%3d: ", i);
Expand All @@ -85,7 +85,7 @@ int show_interrupts(struct seq_file *p, void *v)
seq_putc(p, '\n');
}

spin_unlock_irqrestore(&irq_desc[i].lock, flags);
raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
} else if (i == NR_IRQS) {
seq_printf(p, "Err: %10u\n", atomic_read(&irq_err_count));
}
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 @@ -186,7 +186,7 @@ int show_interrupts(struct seq_file *p, void *v)
seq_puts(p, " CPU0");

if (i < NR_IRQS) {
spin_lock_irqsave(&irq_desc[i].lock, flags);
raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
action = irq_desc[i].action;
if (!action)
goto unlock;
Expand All @@ -200,7 +200,7 @@ int show_interrupts(struct seq_file *p, void *v)
seq_printf(p, ", %s", action->name);
seq_putc(p, '\n');
unlock:
spin_unlock_irqrestore(&irq_desc[i].lock, flags);
raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
}
return 0;
}
Expand Down
6 changes: 3 additions & 3 deletions arch/ia64/kernel/iosapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,12 +793,12 @@ iosapic_register_intr (unsigned int gsi,
goto unlock_iosapic_lock;
}

spin_lock(&irq_desc[irq].lock);
raw_spin_lock(&irq_desc[irq].lock);
dest = get_target_cpu(gsi, irq);
dmode = choose_dmode();
err = register_intr(gsi, irq, dmode, polarity, trigger);
if (err < 0) {
spin_unlock(&irq_desc[irq].lock);
raw_spin_unlock(&irq_desc[irq].lock);
irq = err;
goto unlock_iosapic_lock;
}
Expand All @@ -817,7 +817,7 @@ iosapic_register_intr (unsigned int gsi,
(polarity == IOSAPIC_POL_HIGH ? "high" : "low"),
cpu_logical_id(dest), dest, irq_to_vector(irq));

spin_unlock(&irq_desc[irq].lock);
raw_spin_unlock(&irq_desc[irq].lock);
unlock_iosapic_lock:
spin_unlock_irqrestore(&iosapic_lock, flags);
return irq;
Expand Down
4 changes: 2 additions & 2 deletions arch/ia64/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int show_interrupts(struct seq_file *p, void *v)
}

if (i < NR_IRQS) {
spin_lock_irqsave(&irq_desc[i].lock, flags);
raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
action = irq_desc[i].action;
if (!action)
goto skip;
Expand All @@ -91,7 +91,7 @@ int show_interrupts(struct seq_file *p, void *v)

seq_putc(p, '\n');
skip:
spin_unlock_irqrestore(&irq_desc[i].lock, flags);
raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
} else if (i == NR_IRQS)
seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
return 0;
Expand Down
4 changes: 2 additions & 2 deletions arch/ia64/kernel/irq_ia64.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ static irqreturn_t smp_irq_move_cleanup_interrupt(int irq, void *dev_id)

desc = irq_desc + irq;
cfg = irq_cfg + irq;
spin_lock(&desc->lock);
raw_spin_lock(&desc->lock);
if (!cfg->move_cleanup_count)
goto unlock;

Expand All @@ -358,7 +358,7 @@ static irqreturn_t smp_irq_move_cleanup_interrupt(int irq, void *dev_id)
spin_unlock_irqrestore(&vector_lock, flags);
cfg->move_cleanup_count--;
unlock:
spin_unlock(&desc->lock);
raw_spin_unlock(&desc->lock);
}
return IRQ_HANDLED;
}
Expand Down
4 changes: 2 additions & 2 deletions arch/m32r/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int show_interrupts(struct seq_file *p, void *v)
}

if (i < NR_IRQS) {
spin_lock_irqsave(&irq_desc[i].lock, flags);
raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
action = irq_desc[i].action;
if (!action)
goto skip;
Expand All @@ -59,7 +59,7 @@ int show_interrupts(struct seq_file *p, void *v)

seq_putc(p, '\n');
skip:
spin_unlock_irqrestore(&irq_desc[i].lock, flags);
raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
}
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions arch/microblaze/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int show_interrupts(struct seq_file *p, void *v)
}

if (i < nr_irq) {
spin_lock_irqsave(&irq_desc[i].lock, flags);
raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
action = irq_desc[i].action;
if (!action)
goto skip;
Expand All @@ -89,7 +89,7 @@ int show_interrupts(struct seq_file *p, void *v)

seq_putc(p, '\n');
skip:
spin_unlock_irqrestore(&irq_desc[i].lock, flags);
raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
}
return 0;
}
4 changes: 2 additions & 2 deletions arch/mips/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)
}

if (i < NR_IRQS) {
spin_lock_irqsave(&irq_desc[i].lock, flags);
raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
action = irq_desc[i].action;
if (!action)
goto skip;
Expand All @@ -118,7 +118,7 @@ int show_interrupts(struct seq_file *p, void *v)

seq_putc(p, '\n');
skip:
spin_unlock_irqrestore(&irq_desc[i].lock, flags);
raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
} else if (i == NR_IRQS) {
seq_putc(p, '\n');
seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
Expand Down
Loading

0 comments on commit 239007b

Please sign in to comment.