diff mbox

parisc, don't claim cpu irqs more than once

Message ID 20110611185524.GA1369@hiauly1.hia.nrc.ca (mailing list archive)
State Superseded
Headers show

Commit Message

John David Anglin June 11, 2011, 6:55 p.m. UTC
The CPU irqs (timer and IPI) are not shared and only need to be claimed
once.  A mismatch error occurs if they are claimed more than once.

Signed-off-by: John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Helge Deller <deller@gmx.de>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>

Dave

Comments

Rolf Eike Beer June 11, 2011, 8:20 p.m. UTC | #1
John David Anglin wrote:
> The CPU irqs (timer and IPI) are not shared and only need to be claimed
> once.  A mismatch error occurs if they are claimed more than once.
> 
> Signed-off-by: John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
> Cc: Kyle McMartin <kyle@mcmartin.ca>
> Cc: Helge Deller <deller@gmx.de>
> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
> 
> Dave

It's a bad idea to put the patch behind your signature as it then get's 
stripped by mailers when replying. Anyway...

>         int i;
> +#ifdef CONFIG_SMP
> +       static int irqs_claimed;
> +       if (irqs_claimed)
> +               return;
> +       irqs_claimed = 1;
> +#endif

Shouldn't this be bool then? Now that we have it.

Eike
John David Anglin June 11, 2011, 8:56 p.m. UTC | #2
On Sat, 11 Jun 2011, Rolf Eike Beer wrote:

> >         int i;
> > +#ifdef CONFIG_SMP
> > +       static int irqs_claimed;
> > +       if (irqs_claimed)
> > +               return;
> > +       irqs_claimed = 1;
> > +#endif
> 
> Shouldn't this be bool then? Now that we have it.

Yes but I would like to here with this approach is acceptable.  Another
alternative might be a function init_IRQ_SMP that doesn't call claim_cpu_irqs.

Dave
diff mbox

Patch

diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index c0b1aff..8293704 100644
--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
@@ -393,6 +393,12 @@  static struct irqaction ipi_action = {
 static void claim_cpu_irqs(void)
 {
 	int i;
+#ifdef CONFIG_SMP
+	static int irqs_claimed;
+	if (irqs_claimed)
+		return;
+	irqs_claimed = 1;
+#endif
 	for (i = CPU_IRQ_BASE; i <= CPU_IRQ_MAX; i++) {
 		irq_set_chip_and_handler(i, &cpu_interrupt_type,
 					 handle_percpu_irq);