The gic_all_vpes_local_irq_controller irq_chip in the MIPS GIC driver is
a hack which was necessary due to other drivers & MIPS arch code not
using the percpu interrupt APIs to configure & control interrupts which
are really percpu.

This is no longer a problem - other drivers & arch code support using
the percpu interrupt APIs so we can now remove the
gic_all_vpes_local_irq_controller hack.

Signed-off-by: Paul Burton <paul.bur...@imgtec.com>
Cc: James Hogan <james.ho...@imgtec.com>
Cc: Jason Cooper <ja...@lakedaemon.net>
Cc: Marc Zyngier <marc.zyng...@arm.com>
Cc: Ralf Baechle <r...@linux-mips.org>
Cc: Thomas Gleixner <t...@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: linux-m...@linux-mips.org

---

 drivers/irqchip/irq-mips-gic.c | 69 +++++-------------------------------------
 1 file changed, 7 insertions(+), 62 deletions(-)

diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
index 40159ac12ac8..99dda0618599 100644
--- a/drivers/irqchip/irq-mips-gic.c
+++ b/drivers/irqchip/irq-mips-gic.c
@@ -337,40 +337,6 @@ static struct irq_chip gic_local_irq_controller = {
        .irq_unmask             =       gic_unmask_local_irq,
 };
 
-static void gic_mask_local_irq_all_vpes(struct irq_data *d)
-{
-       int intr = GIC_HWIRQ_TO_LOCAL(d->hwirq);
-       int i;
-       unsigned long flags;
-
-       spin_lock_irqsave(&gic_lock, flags);
-       for (i = 0; i < gic_vpes; i++) {
-               write_gic_vl_other(mips_cm_vp_id(i));
-               write_gic_vo_rmask(BIT(intr));
-       }
-       spin_unlock_irqrestore(&gic_lock, flags);
-}
-
-static void gic_unmask_local_irq_all_vpes(struct irq_data *d)
-{
-       int intr = GIC_HWIRQ_TO_LOCAL(d->hwirq);
-       int i;
-       unsigned long flags;
-
-       spin_lock_irqsave(&gic_lock, flags);
-       for (i = 0; i < gic_vpes; i++) {
-               write_gic_vl_other(mips_cm_vp_id(i));
-               write_gic_vo_smask(BIT(intr));
-       }
-       spin_unlock_irqrestore(&gic_lock, flags);
-}
-
-static struct irq_chip gic_all_vpes_local_irq_controller = {
-       .name                   =       "MIPS GIC Local",
-       .irq_mask               =       gic_mask_local_irq_all_vpes,
-       .irq_unmask             =       gic_unmask_local_irq_all_vpes,
-};
-
 static void __gic_irq_dispatch(void)
 {
        gic_handle_local_int(false);
@@ -471,35 +437,14 @@ static int gic_irq_domain_map(struct irq_domain *d, 
unsigned int virq,
                return gic_shared_irq_domain_map(d, virq, hwirq, 0);
        }
 
-       switch (GIC_HWIRQ_TO_LOCAL(hwirq)) {
-       case GIC_LOCAL_INT_TIMER:
-       case GIC_LOCAL_INT_PERFCTR:
-       case GIC_LOCAL_INT_FDC:
-               /*
-                * HACK: These are all really percpu interrupts, but
-                * the rest of the MIPS kernel code does not use the
-                * percpu IRQ API for them.
-                */
-               err = irq_domain_set_hwirq_and_chip(d, virq, hwirq,
-                                                   
&gic_all_vpes_local_irq_controller,
-                                                   NULL);
-               if (err)
-                       return err;
-
-               irq_set_handler(virq, handle_percpu_irq);
-               break;
+       err = irq_domain_set_hwirq_and_chip(d, virq, hwirq,
+                                           &gic_local_irq_controller,
+                                           NULL);
+       if (err)
+               return err;
 
-       default:
-               err = irq_domain_set_hwirq_and_chip(d, virq, hwirq,
-                                                   &gic_local_irq_controller,
-                                                   NULL);
-               if (err)
-                       return err;
-
-               irq_set_handler(virq, handle_percpu_devid_irq);
-               irq_set_percpu_devid(virq);
-               break;
-       }
+       irq_set_handler(virq, handle_percpu_devid_irq);
+       irq_set_percpu_devid(virq);
 
        return gic_local_irq_domain_map(d, virq, hwirq);
 }
-- 
2.14.1

Reply via email to