diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2009-05-08 08:08:20 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-05-15 02:43:41 -0400 |
commit | 31207dab7d2e63795eb15823947bd2f7025b08e2 (patch) | |
tree | 84607395d7d74e56e32c5155ecec7efee0d90c12 /arch/powerpc/sysdev | |
parent | e5fc948b11a9d0aee1cabe7c82726bc36d496875 (diff) |
powerpc/mpic: Fix incorrect allocation of interrupt rev-map
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.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r-- | arch/powerpc/sysdev/mpic.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 21b956701596..0efc12d1a3d7 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -1057,13 +1057,6 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1057 | memset(mpic, 0, sizeof(struct mpic)); | 1057 | memset(mpic, 0, sizeof(struct mpic)); |
1058 | mpic->name = name; | 1058 | mpic->name = name; |
1059 | 1059 | ||
1060 | mpic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, | ||
1061 | isu_size, &mpic_host_ops, | ||
1062 | flags & MPIC_LARGE_VECTORS ? 2048 : 256); | ||
1063 | if (mpic->irqhost == NULL) | ||
1064 | return NULL; | ||
1065 | |||
1066 | mpic->irqhost->host_data = mpic; | ||
1067 | mpic->hc_irq = mpic_irq_chip; | 1060 | mpic->hc_irq = mpic_irq_chip; |
1068 | mpic->hc_irq.typename = name; | 1061 | mpic->hc_irq.typename = name; |
1069 | if (flags & MPIC_PRIMARY) | 1062 | if (flags & MPIC_PRIMARY) |
@@ -1213,6 +1206,15 @@ struct mpic * __init mpic_alloc(struct device_node *node, | |||
1213 | mpic->isu_shift = 1 + __ilog2(mpic->isu_size - 1); | 1206 | mpic->isu_shift = 1 + __ilog2(mpic->isu_size - 1); |
1214 | mpic->isu_mask = (1 << mpic->isu_shift) - 1; | 1207 | mpic->isu_mask = (1 << mpic->isu_shift) - 1; |
1215 | 1208 | ||
1209 | mpic->irqhost = irq_alloc_host(node, IRQ_HOST_MAP_LINEAR, | ||
1210 | isu_size ? isu_size : mpic->num_sources, | ||
1211 | &mpic_host_ops, | ||
1212 | flags & MPIC_LARGE_VECTORS ? 2048 : 256); | ||
1213 | if (mpic->irqhost == NULL) | ||
1214 | return NULL; | ||
1215 | |||
1216 | mpic->irqhost->host_data = mpic; | ||
1217 | |||
1216 | /* Display version */ | 1218 | /* Display version */ |
1217 | switch (greg_feature & MPIC_GREG_FEATURE_VERSION_MASK) { | 1219 | switch (greg_feature & MPIC_GREG_FEATURE_VERSION_MASK) { |
1218 | case 1: | 1220 | case 1: |