Skip to contentSkip to conversation

powerpc/fsl_msi: fix support for multiple MSI ranges

PATCH Applied Timur Tabi 3 participants 3 messages Sep 13, 2011 – Oct 12, 2011 PowerPC

lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH 1/1 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.

---
 arch/powerpc/sysdev/fsl_msi.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
arch/powerpc/sysdev/fsl_msi.c +5 -3
index 419a772..1cca251 100644
@@ -296,7 +296,7 @@ static int __devinit fsl_msi_setup_hwirq(struct fsl_msi *msi,
 	}
 
 	msi->msi_virqs[irq_index] = virt_msir;
-	cascade_data->index = offset + irq_index;
+	cascade_data->index = offset;
 	cascade_data->msi_data = msi;
 	irq_set_handler_data(virt_msir, cascade_data);
 	irq_set_chained_handler(virt_msir, fsl_msi_cascade);
@@ -376,8 +376,10 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev)
 		goto error_out;
 	}
 
-	if (!p)
+	if (!p) {
 		p = all_avail;
+		len = sizeof(all_avail);
+	}
 
 	for (irq_index = 0, i = 0; i < len / (2 * sizeof(u32)); i++) {
 		if (p[i * 2] % IRQS_PER_MSI_REG ||
@@ -393,7 +395,7 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev)
 		count = p[i * 2 + 1] / IRQS_PER_MSI_REG;
 
 		for (j = 0; j < count; j++, irq_index++) {
-			err = fsl_msi_setup_hwirq(msi, dev, offset, irq_index);
+			err = fsl_msi_setup_hwirq(msi, dev, offset + j, irq_index);
 			if (err)
 				goto error_out;
 		}
Signature · 1 line
1.7.3.4
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Timur Tabi

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.

---
 arch/powerpc/sysdev/fsl_msi.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

-Scott

Applied
#2 lore raw
In reply to Timur Tabi
Quoted 1 line · Timur Tabi

Commit 6820fead ("powerpc/fsl_msi: Handle msi-available-ranges =

better") added

Quoted 1 line

support for multiple ranges in the msi-available-ranges property, but =

it

Quoted 6 lines

miscalculated the MSIR index when multiple ranges are used. =20

---
arch/powerpc/sysdev/fsl_msi.c | 8 +++++---

1 files changed, 5 insertions(+), 3 deletions(-)

applied

- k=