powerpc/mpic: Use new smp_request_message_ipi
authorMilton Miller <miltonm@bga.com>
Fri, 10 Oct 2008 01:56:50 +0000 (01:56 +0000)
committerPaul Mackerras <paulus@samba.org>
Wed, 19 Nov 2008 05:05:07 +0000 (16:05 +1100)
MPIC has 4 ipis, so it can use the new smp_request_message_ipi to
reduce pathlength when receiving an ipi.

This has the side effect of using the common ipi names, and also
continuing to try request the remaining messages when one fails.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/sysdev/mpic.c

index f6299cca7814b8eda0434e94953db9fe6b38ba9e..86a7346f6f20d079fc69adac655f9cd464fd2e04 100644 (file)
@@ -661,17 +661,6 @@ static inline void mpic_eoi(struct mpic *mpic)
        (void)mpic_cpu_read(MPIC_INFO(CPU_WHOAMI));
 }
 
-#ifdef CONFIG_SMP
-static irqreturn_t mpic_ipi_action(int irq, void *data)
-{
-       long ipi = (long)data;
-
-       smp_message_recv(ipi);
-
-       return IRQ_HANDLED;
-}
-#endif /* CONFIG_SMP */
-
 /*
  * Linux descriptor level callbacks
  */
@@ -1543,13 +1532,7 @@ unsigned int mpic_get_mcirq(void)
 void mpic_request_ipis(void)
 {
        struct mpic *mpic = mpic_primary;
-       long i, err;
-       static char *ipi_names[] = {
-               "IPI0 (call function)",
-               "IPI1 (reschedule)",
-               "IPI2 (call function single)",
-               "IPI3 (debugger break)",
-       };
+       int i;
        BUG_ON(mpic == NULL);
 
        printk(KERN_INFO "mpic: requesting IPIs ... \n");
@@ -1558,17 +1541,10 @@ void mpic_request_ipis(void)
                unsigned int vipi = irq_create_mapping(mpic->irqhost,
                                                       mpic->ipi_vecs[0] + i);
                if (vipi == NO_IRQ) {
-                       printk(KERN_ERR "Failed to map IPI %ld\n", i);
-                       break;
-               }
-               err = request_irq(vipi, mpic_ipi_action,
-                                 IRQF_DISABLED|IRQF_PERCPU,
-                                 ipi_names[i], (void *)i);
-               if (err) {
-                       printk(KERN_ERR "Request of irq %d for IPI %ld failed\n",
-                              vipi, i);
-                       break;
+                       printk(KERN_ERR "Failed to map %s\n", smp_ipi_name[i]);
+                       continue;
                }
+               smp_request_message_ipi(vipi, i);
        }
 }