aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-07-01 03:54:09 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-25 17:07:20 -0400
commite544a74525b9accf4919822196f29cd967e7e5c0 (patch)
tree2bb43422305d12a5d4c729feb01f227695e333eb /arch
parent3b743326ed2edd5e118950874f7bdaed5759f977 (diff)
powerpc/powernv: Fix iommu initialization again
commit 74251fe21bfa9310ddba9e0436d1fcf389e602ee upstream. So because those things always end up in trainwrecks... In 7846de406 we moved back the iommu initialization earlier, essentially undoing 37f02195b which was causing us endless trouble... except that in the meantime we had merged 959c9bdd58 (to workaround the original breakage) which is now ... broken :-) This fixes it by doing a partial revert of the latter (we keep the ppc_md. path which will be needed in the hotplug case, which happens also during some EEH error recovery situations). Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/powernv/pci-ioda.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 9c9d15e4cdf2..7816beff1db8 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -441,6 +441,17 @@ static void pnv_pci_ioda_dma_dev_setup(struct pnv_phb *phb, struct pci_dev *pdev
441 set_iommu_table_base(&pdev->dev, &pe->tce32_table); 441 set_iommu_table_base(&pdev->dev, &pe->tce32_table);
442} 442}
443 443
444static void pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe, struct pci_bus *bus)
445{
446 struct pci_dev *dev;
447
448 list_for_each_entry(dev, &bus->devices, bus_list) {
449 set_iommu_table_base(&dev->dev, &pe->tce32_table);
450 if (dev->subordinate)
451 pnv_ioda_setup_bus_dma(pe, dev->subordinate);
452 }
453}
454
444static void pnv_pci_ioda1_tce_invalidate(struct iommu_table *tbl, 455static void pnv_pci_ioda1_tce_invalidate(struct iommu_table *tbl,
445 u64 *startp, u64 *endp) 456 u64 *startp, u64 *endp)
446{ 457{
@@ -596,6 +607,11 @@ static void pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb,
596 } 607 }
597 iommu_init_table(tbl, phb->hose->node); 608 iommu_init_table(tbl, phb->hose->node);
598 609
610 if (pe->pdev)
611 set_iommu_table_base(&pe->pdev->dev, tbl);
612 else
613 pnv_ioda_setup_bus_dma(pe, pe->pbus);
614
599 return; 615 return;
600 fail: 616 fail:
601 /* XXX Failure: Try to fallback to 64-bit only ? */ 617 /* XXX Failure: Try to fallback to 64-bit only ? */
@@ -667,6 +683,11 @@ static void pnv_pci_ioda2_setup_dma_pe(struct pnv_phb *phb,
667 } 683 }
668 iommu_init_table(tbl, phb->hose->node); 684 iommu_init_table(tbl, phb->hose->node);
669 685
686 if (pe->pdev)
687 set_iommu_table_base(&pe->pdev->dev, tbl);
688 else
689 pnv_ioda_setup_bus_dma(pe, pe->pbus);
690
670 return; 691 return;
671fail: 692fail:
672 if (pe->tce32_seg >= 0) 693 if (pe->tce32_seg >= 0)