powerpc/mpic: Fix allocation of reverse-map for multi-ISU mpics
When using a multi-ISU MPIC, we can interrupts up to isu_size * MPIC_MAX_ISU, not just isu_size, so allocate the right size reverse map.
Without this, the code will constantly fallback to a linear search.
---
arch/powerpc/sysdev/mpic.c +2 -1
@@ -1346,7 +1346,8 @@ struct mpic * __init mpic_alloc(struct device_node *node, mpic->isu_mask = (1 << mpic->isu_shift) -1 ; mpic->irqhost =irq_alloc_host (mpic->node,IRQ_HOST_MAP_LINEAR , - isu_size ? isu_size : mpic->num_sources, + isu_size ? isu_size *MPIC_MAX_ISU : + mpic->num_sources, &mpic_host_ops, flags &MPIC_LARGE_VECTORS ?2048 :256 );
Quoted 8 lines · Benjamin Herrenschmidt
When using a multi-ISU MPIC, we can interrupts up to
isu_size*MPIC_MAX_ISU, not justisu_size, so allocate the right size reverse map.Without this, the code will constantly fallback to a linear search.
Signed-off-by Benjamin Herrenschmidt <[email protected]>
Looks fine to me. This will conflict with the irqdomain tree in linux-next, but it will be a trivial fixup. Still, if you prefer I can pick this up into my tree.
g.
Quoted 18 lines
---
arch/powerpc/sysdev/mpic.c +2
-1@@ -1346,7 +1346,8 @@ struct mpic * __init mpic_alloc(struct device_node *node, mpic->isu_mask = (1 << mpic->isu_shift) -1 ; mpic->irqhost =irq_alloc_host (mpic->node,IRQ_HOST_MAP_LINEAR , - isu_size ? isu_size : mpic->num_sources, + isu_size ? isu_size *MPIC_MAX_ISU : + mpic->num_sources, &mpic_host_ops, flags &MPIC_LARGE_VECTORS ?2048 :256 );
Quoted 4 lines · Grant Likely
Looks fine to me. This will conflict with the irqdomain tree in linux-next, but it will be a trivial fixup. Still, if you prefer I can pick this up into my tree.
Well, I'm also going to carry a slightly modified variant of Kyle's mpic series so we'll have to deal with conflicts regardless, I'll keep that one.
What I might do tho is pull your tree in powerpc-next at some point, when you tell me it's frozen solid, this will potentially make my life easier.
Cheers,
Ben.
Quoted 3 lines · Benjamin Herrenschmidt
Quoted 2 lines · Grant Likely
Looks fine to me. =A0This will conflict with the irqdomain tree in linux=
-next,
Quoted 10 lines
Quoted 2 lines
but it will be a trivial fixup. =A0Still, if you prefer I can pick this up into my tree.
Well, I'm also going to carry a slightly modified variant of Kyle's mpic series so we'll have to deal with conflicts regardless, I'll keep that one.
What I might do tho is pull your tree in powerpc-next at some point, when you tell me it's frozen solid, this will potentially make my life easier.
It's frozen solid now. Any changes from this point on will be new patches on top.
g.