* [PATCH] irq_domain/mips: Allow irq_domain on MIPS
@ 2012-02-24 16:29 Grant Likely
2012-03-06 19:57 ` Ralf Baechle
0 siblings, 1 reply; 3+ messages in thread
From: Grant Likely @ 2012-02-24 16:29 UTC (permalink / raw)
To: linux-kernel
Cc: Grant Likely, Ralf Baechle, Rob Herring, Thomas Gleixner,
linux-mips
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
---
This applies on top of linux-next or my irqdomain/next branch. Ralf, with
your ack I should merge it via that tree.
git://git.secretlab.ca/git/linux-2.6 irqdomain/next
arch/mips/Kconfig | 1 +
arch/mips/include/asm/irq.h | 5 +----
arch/mips/kernel/prom.c | 14 --------------
kernel/irq/irqdomain.c | 12 ++++++++++++
4 files changed, 14 insertions(+), 18 deletions(-)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 5ab6e89..edbbae1 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -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.
diff --git a/arch/mips/include/asm/irq.h b/arch/mips/include/asm/irq.h
index 2354c87..fb698dc 100644
--- a/arch/mips/include/asm/irq.h
+++ b/arch/mips/include/asm/irq.h
@@ -11,15 +11,12 @@
#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)
{
diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c
index 6b8b420..558b539 100644
--- a/arch/mips/kernel/prom.c
+++ b/arch/mips/kernel/prom.c
@@ -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 */
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 25a498e..af48e59 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -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;
--
1.7.9
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] irq_domain/mips: Allow irq_domain on MIPS
2012-02-24 16:29 [PATCH] irq_domain/mips: Allow irq_domain on MIPS Grant Likely
@ 2012-03-06 19:57 ` Ralf Baechle
2012-03-06 23:08 ` David Daney
0 siblings, 1 reply; 3+ messages in thread
From: Ralf Baechle @ 2012-03-06 19:57 UTC (permalink / raw)
To: Grant Likely; +Cc: linux-kernel, Rob Herring, Thomas Gleixner, linux-mips
On Fri, Feb 24, 2012 at 09:29:55AM -0700, Grant Likely wrote:
> 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
Looking good, Ack.
Is there any good example for the changes that need to be done to
irq controller drivers?
Thanks,
Ralf
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] irq_domain/mips: Allow irq_domain on MIPS
2012-03-06 19:57 ` Ralf Baechle
@ 2012-03-06 23:08 ` David Daney
0 siblings, 0 replies; 3+ messages in thread
From: David Daney @ 2012-03-06 23:08 UTC (permalink / raw)
To: Ralf Baechle
Cc: Grant Likely, linux-kernel, Rob Herring, Thomas Gleixner,
linux-mips
On 03/06/2012 11:57 AM, Ralf Baechle wrote:
> On Fri, Feb 24, 2012 at 09:29:55AM -0700, Grant Likely wrote:
>
>> 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
>
> Looking good, Ack.
>
> Is there any good example for the changes that need to be done to
> irq controller drivers?
>
Well it only affects things that have USE_OF, so most mips things will
not need to do anything as they don't USE_OF.
But for those that do USE_OF, you have to call one or more of the
irq_domain_add_*() functions.
Slightly off topic: My OCTEON patch set tries to do this, but hasn't
met with quite as much enthusiasm as I would have liked...
David Daney
> Thanks,
>
> Ralf
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-03-06 23:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-24 16:29 [PATCH] irq_domain/mips: Allow irq_domain on MIPS Grant Likely
2012-03-06 19:57 ` Ralf Baechle
2012-03-06 23:08 ` David Daney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).