Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/powernv: Needn't IO segment map for PHB3

PHB3 doesn't support IO ports and we needn't IO segment map for that.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Gavin Shan and committed by
Benjamin Herrenschmidt
c35d2a8c 2f1ec02e

+7 -6
+7 -6
arch/powerpc/platforms/powernv/pci-ioda.c
··· 1187 1187 phb->ioda.io_segsize = phb->ioda.io_size / phb->ioda.total_pe; 1188 1188 phb->ioda.io_pci_base = 0; /* XXX calculate this ? */ 1189 1189 1190 - /* Allocate aux data & arrays 1191 - * 1192 - * XXX TODO: Don't allocate io segmap on PHB3 1193 - */ 1190 + /* Allocate aux data & arrays. We don't have IO ports on PHB3 */ 1194 1191 size = _ALIGN_UP(phb->ioda.total_pe / 8, sizeof(unsigned long)); 1195 1192 m32map_off = size; 1196 1193 size += phb->ioda.total_pe * sizeof(phb->ioda.m32_segmap[0]); 1197 1194 iomap_off = size; 1198 - size += phb->ioda.total_pe * sizeof(phb->ioda.io_segmap[0]); 1195 + if (phb->type == PNV_PHB_IODA1) { 1196 + iomap_off = size; 1197 + size += phb->ioda.total_pe * sizeof(phb->ioda.io_segmap[0]); 1198 + } 1199 1199 pemap_off = size; 1200 1200 size += phb->ioda.total_pe * sizeof(struct pnv_ioda_pe); 1201 1201 aux = alloc_bootmem(size); 1202 1202 memset(aux, 0, size); 1203 1203 phb->ioda.pe_alloc = aux; 1204 1204 phb->ioda.m32_segmap = aux + m32map_off; 1205 - phb->ioda.io_segmap = aux + iomap_off; 1205 + if (phb->type == PNV_PHB_IODA1) 1206 + phb->ioda.io_segmap = aux + iomap_off; 1206 1207 phb->ioda.pe_array = aux + pemap_off; 1207 1208 set_bit(0, phb->ioda.pe_alloc); 1208 1209