diff options
author | Timur Tabi <timur@freescale.com> | 2011-09-13 17:17:00 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2011-10-11 17:18:55 -0400 |
commit | 2228511833e267e833514cc85ba9626f9dacd661 (patch) | |
tree | 0e23bd60170f0b9dd1167ae036382e6d551d5a87 /arch/powerpc/sysdev | |
parent | 2a05e333c2cee711c828d79300010b721c81574f (diff) |
powerpc/fsl_msi: fix support for multiple MSI ranges
Commit 6820fead ("powerpc/fsl_msi: Handle msi-available-ranges better") added
support for multiple ranges in the msi-available-ranges property, but it
miscalculated the MSIR index when multiple ranges are used.
Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r-- | arch/powerpc/sysdev/fsl_msi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c index 419a77239bd7..1cca25146b1f 100644 --- a/arch/powerpc/sysdev/fsl_msi.c +++ b/arch/powerpc/sysdev/fsl_msi.c | |||
@@ -296,7 +296,7 @@ static int __devinit fsl_msi_setup_hwirq(struct fsl_msi *msi, | |||
296 | } | 296 | } |
297 | 297 | ||
298 | msi->msi_virqs[irq_index] = virt_msir; | 298 | msi->msi_virqs[irq_index] = virt_msir; |
299 | cascade_data->index = offset + irq_index; | 299 | cascade_data->index = offset; |
300 | cascade_data->msi_data = msi; | 300 | cascade_data->msi_data = msi; |
301 | irq_set_handler_data(virt_msir, cascade_data); | 301 | irq_set_handler_data(virt_msir, cascade_data); |
302 | irq_set_chained_handler(virt_msir, fsl_msi_cascade); | 302 | irq_set_chained_handler(virt_msir, fsl_msi_cascade); |
@@ -376,8 +376,10 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev) | |||
376 | goto error_out; | 376 | goto error_out; |
377 | } | 377 | } |
378 | 378 | ||
379 | if (!p) | 379 | if (!p) { |
380 | p = all_avail; | 380 | p = all_avail; |
381 | len = sizeof(all_avail); | ||
382 | } | ||
381 | 383 | ||
382 | for (irq_index = 0, i = 0; i < len / (2 * sizeof(u32)); i++) { | 384 | for (irq_index = 0, i = 0; i < len / (2 * sizeof(u32)); i++) { |
383 | if (p[i * 2] % IRQS_PER_MSI_REG || | 385 | if (p[i * 2] % IRQS_PER_MSI_REG || |
@@ -393,7 +395,7 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev) | |||
393 | count = p[i * 2 + 1] / IRQS_PER_MSI_REG; | 395 | count = p[i * 2 + 1] / IRQS_PER_MSI_REG; |
394 | 396 | ||
395 | for (j = 0; j < count; j++, irq_index++) { | 397 | for (j = 0; j < count; j++, irq_index++) { |
396 | err = fsl_msi_setup_hwirq(msi, dev, offset, irq_index); | 398 | err = fsl_msi_setup_hwirq(msi, dev, offset + j, irq_index); |
397 | if (err) | 399 | if (err) |
398 | goto error_out; | 400 | goto error_out; |
399 | } | 401 | } |