powerpc/powernv: Don't use pe->pbus to get the domain number
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Thu, 24 Apr 2014 08:00:29 +0000 (18:00 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 28 Apr 2014 07:35:14 +0000 (17:35 +1000)
If the PE contains single PCI function, "pe->pbus" would be NULL.
It's not reliable to be used by pci_domain_nr().  We just grab the
PCI domain number from the PCI host controller (struct pci_controller)
instance.

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 a02da4ddd1b583d6687a28bff814fe85110bf146..de19edeaa7a75f1e21dedd0babbf57727c6d4afb 100644 (file)
@@ -672,7 +672,7 @@ static void pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb,
                                 TCE_PCI_SWINV_PAIR);
        }
        iommu_init_table(tbl, phb->hose->node);
-       iommu_register_group(tbl, pci_domain_nr(pe->pbus), pe->pe_number);
+       iommu_register_group(tbl, phb->hose->global_number, pe->pe_number);
 
        if (pe->pdev)
                set_iommu_table_base_and_group(&pe->pdev->dev, tbl);
@@ -800,7 +800,7 @@ static void pnv_pci_ioda2_setup_dma_pe(struct pnv_phb *phb,
                tbl->it_type |= (TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE);
        }
        iommu_init_table(tbl, phb->hose->node);
-       iommu_register_group(tbl, pci_domain_nr(pe->pbus), pe->pe_number);
+       iommu_register_group(tbl, phb->hose->global_number, pe->pe_number);
 
        if (pe->pdev)
                set_iommu_table_base_and_group(&pe->pdev->dev, tbl);