[PATCH] powerpc/powernv: Fix next available MSI IRQ

Gavin Shan shangw at linux.vnet.ibm.com
Tue Mar 5 17:59:16 EST 2013


The allocation of MSI is implemented based on bitmap and working
like the mechanism of strict round through the traced next available
cursor. However, the next available MSI is never updated in current
implementation. The patch fixes the issue.

Signed-off-by: Gavin Shan <shangw at linux.vnet.ibm.com>
---
 arch/powerpc/platforms/powernv/pci.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index 6f464dc..9cf18c4 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -66,6 +66,11 @@ static unsigned int pnv_get_one_msi(struct pnv_phb *phb)
 		rc = 0;
 		goto out;
 	}
+
+	if (id >= phb->msi_count - 1)
+		phb->msi_next = 0;
+	else
+		phb->msi_next = id + 1;
 	__set_bit(id, phb->msi_map);
 	rc = id + phb->msi_base;
 out:
-- 
1.7.5.4



More information about the Linuxppc-dev mailing list