diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-02-22 08:50:13 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-02-26 19:33:58 -0500 |
commit | fe83364f0bf11fcb20cecbe944a95834632ffffb (patch) | |
tree | 5596915cd3980617166522aabcd7d5f8b71b5c49 /arch/powerpc/sysdev | |
parent | f851013cb2238a82782da03ac82a14447933f90d (diff) |
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.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r-- | arch/powerpc/sysdev/mpic.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index b9b989d305dd..16eb743b38a7 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -1331,9 +1331,13 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1331 | /* | 1331 | /* |
1332 | * By default, the last source number comes from the MPIC, but the | 1332 | * By default, the last source number comes from the MPIC, but the |
1333 | * device-tree and board support code can override it on buggy hw. | 1333 | * device-tree and board support code can override it on buggy hw. |
1334 | * If we get passed an isu_size (multi-isu MPIC) then we use that | ||
1335 | * as a default instead of the value read from the HW. | ||
1334 | */ | 1336 | */ |
1335 | last_irq = (greg_feature & MPIC_GREG_FEATURE_LAST_SRC_MASK) | 1337 | last_irq = (greg_feature & MPIC_GREG_FEATURE_LAST_SRC_MASK) |
1336 | >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT; | 1338 | >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT; |
1339 | if (isu_size) | ||
1340 | last_irq = isu_size * MPIC_MAX_ISU - 1; | ||
1337 | of_property_read_u32(mpic->node, "last-interrupt-source", &last_irq); | 1341 | of_property_read_u32(mpic->node, "last-interrupt-source", &last_irq); |
1338 | if (irq_count) | 1342 | if (irq_count) |
1339 | last_irq = irq_count - 1; | 1343 | last_irq = irq_count - 1; |
@@ -1352,7 +1356,7 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1352 | mpic->isu_mask = (1 << mpic->isu_shift) - 1; | 1356 | mpic->isu_mask = (1 << mpic->isu_shift) - 1; |
1353 | 1357 | ||
1354 | mpic->irqhost = irq_alloc_host(mpic->node, IRQ_HOST_MAP_LINEAR, | 1358 | mpic->irqhost = irq_alloc_host(mpic->node, IRQ_HOST_MAP_LINEAR, |
1355 | mpic->isu_size, &mpic_host_ops, | 1359 | last_irq + 1, &mpic_host_ops, |
1356 | intvec_top + 1); | 1360 | intvec_top + 1); |
1357 | 1361 | ||
1358 | /* | 1362 | /* |