aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGavin Shan <shangw@linux.vnet.ibm.com>2012-08-19 23:49:19 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-09-17 02:35:15 -0400
commite47747f479502cf5dc1f8043fbc7513a4dc8fd9f (patch)
tree829249e99f9949851af58d21b9e8e1da17beed7d
parentdb1266c852611436daa01a89c272722ec39cf916 (diff)
powerpc/powernv: Fix overrunning segment tracing array
There're 2 arrays introduced to trace which PE has occupied the corresponding resource (I/O or MMIO) segment. However, we didn't allocate enough memory for them and that possiblly leads to PE descriptor corruption. The patch fixes that by allocating enough memory for those 2 arrays. Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com> Reviewed-by: Ram Pai <linuxram@us.ibm.com> Reviewed-by: Richard Yang <weiyang@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/platforms/powernv/pci-ioda.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index c4461ad8a689..40559bf2b9ec 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -1411,9 +1411,9 @@ void __init pnv_pci_init_ioda1_phb(struct device_node *np)
1411 /* Allocate aux data & arrays */ 1411 /* Allocate aux data & arrays */
1412 size = _ALIGN_UP(phb->ioda.total_pe / 8, sizeof(unsigned long)); 1412 size = _ALIGN_UP(phb->ioda.total_pe / 8, sizeof(unsigned long));
1413 m32map_off = size; 1413 m32map_off = size;
1414 size += phb->ioda.total_pe; 1414 size += phb->ioda.total_pe * sizeof(phb->ioda.m32_segmap[0]);
1415 iomap_off = size; 1415 iomap_off = size;
1416 size += phb->ioda.total_pe; 1416 size += phb->ioda.total_pe * sizeof(phb->ioda.io_segmap[0]);
1417 pemap_off = size; 1417 pemap_off = size;
1418 size += phb->ioda.total_pe * sizeof(struct pnv_ioda_pe); 1418 size += phb->ioda.total_pe * sizeof(struct pnv_ioda_pe);
1419 aux = alloc_bootmem(size); 1419 aux = alloc_bootmem(size);