powerpc/powernv: Don't map M64 segments using M32DT
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Fri, 27 Mar 2015 00:29:00 +0000 (11:29 +1100)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 31 Mar 2015 02:10:40 +0000 (13:10 +1100)
If M64 has been supported, the prefetchable 64-bits memory resources
shouldn't be mapped to the corresponding PE# via M32DT. Unfortunately,
we're doing that in pnv_ioda_setup_pe_seg() wrongly. The issue was
introduced by commit 262af55 ("powerpc/powernv: Enable M64 aperatus
for PHB3"). The patch fixes the issue by simply skipping M64 resources
when updating to M32DT.

Cc: <stable@vger.kernel.org> # v3.17+
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/powernv/pci-ioda.c

index 26fe09936935550d587c041f4831686e334c0b37..76b344125cef9d545d48c9235f0da5d600d8e1a1 100644 (file)
@@ -1777,7 +1777,8 @@ static void pnv_ioda_setup_pe_seg(struct pci_controller *hose,
                                region.start += phb->ioda.io_segsize;
                                index++;
                        }
-               } else if (res->flags & IORESOURCE_MEM) {
+               } else if ((res->flags & IORESOURCE_MEM) &&
+                          !pnv_pci_is_mem_pref_64(res->flags)) {
                        region.start = res->start -
                                       hose->mem_offset[0] -
                                       phb->ioda.m32_pci_base;