powerpc/mpic: improve interrupt handling performance

Message ID 1242008047.7767.33.camel@concordia
State Accepted, archived
Headers show

Commit Message

Michael Ellerman May 11, 2009, 2:14 a.m.
On Fri, 2009-05-08 at 17:08 -0500, Kumar Gala wrote:
> Before when we were setting up the irq host map for mpic we passed in
> just isu_size for the size of the linear map.  However, for a number of
> mpic implementations we have no isu (thus pass in 0) and will end up
> with a no linear map (size = 0).  This causes us to always call
> irq_find_mapping() from mpic_get_irq().
> By moving the allocation of the host map to after we've determined the
> number of sources we can actually benefit from having a linear map for
> the non-isu users that covers all the interrupt sources.

That's a nasty bug, so I think we should do:

To save anyone else the embarrassment :)



diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 7d46e5d..2b958d6 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -537,6 +537,7 @@  struct irq_host *irq_alloc_host(struct device_node *of_node,
        case IRQ_HOST_MAP_LINEAR:
+               WARN_ON(revmap_arg == 0);
                rmap = (unsigned int *)(host + 1);
                for (i = 0; i < revmap_arg; i++)
                        rmap[i] = NO_IRQ;