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:

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,
                }
                break;
        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;

To save anyone else the embarrassment :)

cheers

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to