]> err.no Git - linux-2.6/blobdiff - arch/powerpc/sysdev/mpic.c
[POWERPC] Fix spurious vectors on weird MPIC
[linux-2.6] / arch / powerpc / sysdev / mpic.c
index 4e54a09dd33b1fc0c197ad77fa4c47123ba6b0a5..57b1208ef1c3380bb51fe68e6ef6bbb92312d42d 100644 (file)
@@ -304,7 +304,7 @@ static void __init mpic_test_broken_ipi(struct mpic *mpic)
        }
 }
 
-#ifdef CONFIG_MPIC_BROKEN_U3
+#ifdef CONFIG_MPIC_U3_HT_IRQS
 
 /* Test if an interrupt is sourced from HyperTransport (used on broken U3s)
  * to force the edge setting on the MPIC and do the ack workaround.
@@ -476,7 +476,7 @@ static void __init mpic_scan_ht_pics(struct mpic *mpic)
        }
 }
 
-#else /* CONFIG_MPIC_BROKEN_U3 */
+#else /* CONFIG_MPIC_U3_HT_IRQS */
 
 static inline int mpic_is_ht_interrupt(struct mpic *mpic, unsigned int source)
 {
@@ -487,7 +487,7 @@ static void __init mpic_scan_ht_pics(struct mpic *mpic)
 {
 }
 
-#endif /* CONFIG_MPIC_BROKEN_U3 */
+#endif /* CONFIG_MPIC_U3_HT_IRQS */
 
 
 #define mpic_irq_to_hw(virq)   ((unsigned int)irq_map[virq].hwirq)
@@ -615,7 +615,7 @@ static void mpic_end_irq(unsigned int irq)
        mpic_eoi(mpic);
 }
 
-#ifdef CONFIG_MPIC_BROKEN_U3
+#ifdef CONFIG_MPIC_U3_HT_IRQS
 
 static void mpic_unmask_ht_irq(unsigned int irq)
 {
@@ -665,7 +665,7 @@ static void mpic_end_ht_irq(unsigned int irq)
                mpic_ht_end_irq(mpic, src);
        mpic_eoi(mpic);
 }
-#endif /* !CONFIG_MPIC_BROKEN_U3 */
+#endif /* !CONFIG_MPIC_U3_HT_IRQS */
 
 #ifdef CONFIG_SMP
 
@@ -788,7 +788,7 @@ static struct irq_chip mpic_ipi_chip = {
 };
 #endif /* CONFIG_SMP */
 
-#ifdef CONFIG_MPIC_BROKEN_U3
+#ifdef CONFIG_MPIC_U3_HT_IRQS
 static struct irq_chip mpic_irq_ht_chip = {
        .startup        = mpic_startup_ht_irq,
        .shutdown       = mpic_shutdown_ht_irq,
@@ -797,7 +797,7 @@ static struct irq_chip mpic_irq_ht_chip = {
        .eoi            = mpic_end_ht_irq,
        .set_type       = mpic_set_irq_type,
 };
-#endif /* CONFIG_MPIC_BROKEN_U3 */
+#endif /* CONFIG_MPIC_U3_HT_IRQS */
 
 
 static int mpic_host_match(struct irq_host *h, struct device_node *node)
@@ -837,11 +837,11 @@ static int mpic_host_map(struct irq_host *h, unsigned int virq,
        /* Default chip */
        chip = &mpic->hc_irq;
 
-#ifdef CONFIG_MPIC_BROKEN_U3
+#ifdef CONFIG_MPIC_U3_HT_IRQS
        /* Check for HT interrupts, override vecpri */
        if (mpic_is_ht_interrupt(mpic, hw))
                chip = &mpic->hc_ht_irq;
-#endif /* CONFIG_MPIC_BROKEN_U3 */
+#endif /* CONFIG_MPIC_U3_HT_IRQS */
 
        DBG("mpic: mapping to irq chip @%p\n", chip);
 
@@ -937,12 +937,12 @@ struct mpic * __init mpic_alloc(struct device_node *node,
        mpic->hc_irq.typename = name;
        if (flags & MPIC_PRIMARY)
                mpic->hc_irq.set_affinity = mpic_set_affinity;
-#ifdef CONFIG_MPIC_BROKEN_U3
+#ifdef CONFIG_MPIC_U3_HT_IRQS
        mpic->hc_ht_irq = mpic_irq_ht_chip;
        mpic->hc_ht_irq.typename = name;
        if (flags & MPIC_PRIMARY)
                mpic->hc_ht_irq.set_affinity = mpic_set_affinity;
-#endif /* CONFIG_MPIC_BROKEN_U3 */
+#endif /* CONFIG_MPIC_U3_HT_IRQS */
 
 #ifdef CONFIG_SMP
        mpic->hc_ipi = mpic_ipi_chip;
@@ -970,7 +970,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
        mpic->spurious_vec  = intvec_top;
 
        /* Check for "big-endian" in device-tree */
-       if (node && get_property(node, "big-endian", NULL) != NULL)
+       if (node && of_get_property(node, "big-endian", NULL) != NULL)
                mpic->flags |= MPIC_BIG_ENDIAN;
 
 
@@ -986,13 +986,13 @@ struct mpic * __init mpic_alloc(struct device_node *node,
        BUG_ON(paddr == 0 && node == NULL);
 
        /* If no physical address passed in, check if it's dcr based */
-       if (paddr == 0 && get_property(node, "dcr-reg", NULL) != NULL)
+       if (paddr == 0 && of_get_property(node, "dcr-reg", NULL) != NULL)
                mpic->flags |= MPIC_USES_DCR;
 
 #ifdef CONFIG_PPC_DCR
        if (mpic->flags & MPIC_USES_DCR) {
                const u32 *dbasep;
-               dbasep = get_property(node, "dcr-reg", NULL);
+               dbasep = of_get_property(node, "dcr-reg", NULL);
                BUG_ON(dbasep == NULL);
                mpic->dcr_base = *dbasep;
                mpic->reg_type = mpic_access_dcr;
@@ -1006,7 +1006,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
         */
        if (paddr == 0 && !(mpic->flags & MPIC_USES_DCR)) {
                const u32 *reg;
-               reg = get_property(node, "reg", NULL);
+               reg = of_get_property(node, "reg", NULL);
                BUG_ON(reg == NULL);
                paddr = of_translate_address(node, reg);
                BUG_ON(paddr == OF_BAD_ADDR);
@@ -1142,7 +1142,7 @@ void __init mpic_init(struct mpic *mpic)
 
        /* Do the HT PIC fixups on U3 broken mpic */
        DBG("MPIC flags: %x\n", mpic->flags);
-       if ((mpic->flags & MPIC_BROKEN_U3) && (mpic->flags & MPIC_PRIMARY))
+       if ((mpic->flags & MPIC_U3_HT_IRQS) && (mpic->flags & MPIC_PRIMARY))
                mpic_scan_ht_pics(mpic);
 
        for (i = 0; i < mpic->num_sources; i++) {
@@ -1333,8 +1333,11 @@ unsigned int mpic_get_one_irq(struct mpic *mpic)
 #ifdef DEBUG_LOW
        DBG("%s: get_one_irq(): %d\n", mpic->name, src);
 #endif
-       if (unlikely(src == mpic->spurious_vec))
+       if (unlikely(src == mpic->spurious_vec)) {
+               if (mpic->flags & MPIC_SPV_EOI)
+                       mpic_eoi(mpic);
                return NO_IRQ;
+       }
        return irq_linear_revmap(mpic->irqhost, src);
 }
 
@@ -1370,7 +1373,7 @@ void mpic_request_ipis(void)
                        printk(KERN_ERR "Failed to map IPI %d\n", i);
                        break;
                }
-               request_irq(vipi, mpic_ipi_action, IRQF_DISABLED,
+               request_irq(vipi, mpic_ipi_action, IRQF_DISABLED|IRQF_PERCPU,
                            ipi_names[i], mpic);
        }
 }