Skip to contentSkip to conversation

powerpc/mpic: Fix allocation of reverse-map for multi-ISU mpics

PATCH Benjamin Herrenschmidt 2 participants 4 messages Feb 22, 2012 – Feb 23, 2012 PowerPC

lore
Share & tools
lore
#0 lore raw

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
index 4e9ccb1..7fb3ab5 100644
@@ -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);
 
#1 lore raw
Quoted 8 lines · Benjamin Herrenschmidt

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.

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
index 4e9ccb1..7fb3ab5 100644
@@ -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);
 
#2 lore raw
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.

#3 lore raw
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.