Commit 3fa23ff8 authored by Gavin Shan's avatar Gavin Shan Committed by Michael Ellerman

powerpc/powernv: Fix initial IO and M32 segmap

There are two arrays for IO and M32 segment maps on every PHB.
The index of the arrays are segment number and the value stored
in the corresponding element is PE number, indicating the segment
is assigned to the PE. Initially, all elements in those two arrays
are zeroes, meaning all segments are assigned to PE#0. It's wrong.

This fixes the initial values in the elements of those two arrays
to IODA_INVALID_PE, meaning all segments aren't assigned to any
PE.
Signed-off-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 689ee8c9
...@@ -3240,6 +3240,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np, ...@@ -3240,6 +3240,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
const __be64 *prop64; const __be64 *prop64;
const __be32 *prop32; const __be32 *prop32;
int len; int len;
unsigned int segno;
u64 phb_id; u64 phb_id;
void *aux; void *aux;
long rc; long rc;
...@@ -3334,8 +3335,13 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np, ...@@ -3334,8 +3335,13 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
aux = memblock_virt_alloc(size, 0); aux = memblock_virt_alloc(size, 0);
phb->ioda.pe_alloc = aux; phb->ioda.pe_alloc = aux;
phb->ioda.m32_segmap = aux + m32map_off; phb->ioda.m32_segmap = aux + m32map_off;
if (phb->type == PNV_PHB_IODA1) for (segno = 0; segno < phb->ioda.total_pe_num; segno++)
phb->ioda.m32_segmap[segno] = IODA_INVALID_PE;
if (phb->type == PNV_PHB_IODA1) {
phb->ioda.io_segmap = aux + iomap_off; phb->ioda.io_segmap = aux + iomap_off;
for (segno = 0; segno < phb->ioda.total_pe_num; segno++)
phb->ioda.io_segmap[segno] = IODA_INVALID_PE;
}
phb->ioda.pe_array = aux + pemap_off; phb->ioda.pe_array = aux + pemap_off;
set_bit(phb->ioda.reserved_pe_idx, phb->ioda.pe_alloc); set_bit(phb->ioda.reserved_pe_idx, phb->ioda.pe_alloc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment