irq_domain/mips: Allow irq_domain on MIPS
authorGrant Likely <grant.likely@secretlab.ca>
Fri, 24 Feb 2012 15:07:06 +0000 (08:07 -0700)
committerGrant Likely <grant.likely@secretlab.ca>
Fri, 24 Feb 2012 16:47:23 +0000 (09:47 -0700)
This patch makes IRQ_DOMAIN usable on MIPS.  It uses an ugly workaround
to preserve current behaviour so that MIPS has time to add irq_domain
registration to the irq controller drivers.  The workaround will be
removed in Linux v3.6

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mips@linux-mips.org
arch/mips/Kconfig
arch/mips/include/asm/irq.h
arch/mips/kernel/prom.c
kernel/irq/irqdomain.c

index 5ab6e89603c56bc461de1b4390ada67482749c2e..edbbae17e8209e08833bb8acc6801c433cb1ee1f 100644 (file)
@@ -2327,6 +2327,7 @@ config USE_OF
        bool "Flattened Device Tree support"
        select OF
        select OF_EARLY_FLATTREE
+       select IRQ_DOMAIN
        help
          Include support for flattened device tree machine descriptions.
 
index 2354c870a63a1f8eb06bcce96d7036b767bb0497..fb698dc09bc9c39c60cf7c0d43992b424e239551 100644 (file)
 
 #include <linux/linkage.h>
 #include <linux/smp.h>
+#include <linux/irqdomain.h>
 
 #include <asm/mipsmtregs.h>
 
 #include <irq.h>
 
-static inline void irq_dispose_mapping(unsigned int virq)
-{
-}
-
 #ifdef CONFIG_I8259
 static inline int irq_canonicalize(int irq)
 {
index 6b8b4208481e6855104508711fc98e60aa3ac844..558b5395795df810d01c97ed36efa96fc9141eea 100644 (file)
@@ -60,20 +60,6 @@ void __init early_init_dt_setup_initrd_arch(unsigned long start,
 }
 #endif
 
-/*
- * irq_create_of_mapping - Hook to resolve OF irq specifier into a Linux irq#
- *
- * Currently the mapping mechanism is trivial; simple flat hwirq numbers are
- * mapped 1:1 onto Linux irq numbers.  Cascaded irq controllers are not
- * supported.
- */
-unsigned int irq_create_of_mapping(struct device_node *controller,
-                                  const u32 *intspec, unsigned int intsize)
-{
-       return intspec[0];
-}
-EXPORT_SYMBOL_GPL(irq_create_of_mapping);
-
 void __init early_init_devtree(void *params)
 {
        /* Setup flat device-tree pointer */
index 25a498eb98a3ef21e303f43149de10a8bf97c176..af48e59bc2ff4ebd46b08bc9898e328540039cc2 100644 (file)
@@ -411,6 +411,18 @@ unsigned int irq_create_of_mapping(struct device_node *controller,
 
        domain = controller ? irq_find_host(controller) : irq_default_domain;
        if (!domain) {
+#ifdef CONFIG_MIPS
+               /*
+                * Workaround to avoid breaking interrupt controller drivers
+                * that don't yet register an irq_domain.  This is temporary
+                * code. ~~~gcl, Feb 24, 2012
+                *
+                * Scheduled for removal in Linux v3.6.  That should be enough
+                * time.
+                */
+               if (intsize > 0)
+                       return intspec[0];
+#endif
                printk(KERN_WARNING "irq: no irq domain found for %s !\n",
                       controller->full_name);
                return 0;