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

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

4 messages, 2 authors, 2012-02-23 · open the first message on its own page

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

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2012-02-22 23:50:21

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.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 4e9ccb1..7fb3ab5 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -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);
 

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

From: Grant Likely <hidden>
Date: 2012-02-23 01:39:52

On Thu, Feb 23, 2012 at 10:50:13AM +1100, Benjamin Herrenschmidt wrote:
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.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
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 hunk
---
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 4e9ccb1..7fb3ab5 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -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);
 

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

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2012-02-23 01:55:12

On Wed, 2012-02-22 at 18:39 -0700, Grant Likely wrote:
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.

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

From: Grant Likely <hidden>
Date: 2012-02-23 02:00:07

On Wed, Feb 22, 2012 at 6:55 PM, Benjamin Herrenschmidt
[off-list ref] wrote:
On Wed, 2012-02-22 at 18:39 -0700, Grant Likely wrote:
quoted
Looks fine to me. =A0This will conflict with the irqdomain tree in linux=
-next,
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help