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

powerpc/powernv: Don't use pe->pbus to get the domain number

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>

authored by

Gavin Shan and committed by
Benjamin Herrenschmidt
e9bc03fe 65fd766b

+2 -2
+2 -2
arch/powerpc/platforms/powernv/pci-ioda.c
··· 672 672 TCE_PCI_SWINV_PAIR); 673 673 } 674 674 iommu_init_table(tbl, phb->hose->node); 675 - iommu_register_group(tbl, pci_domain_nr(pe->pbus), pe->pe_number); 675 + iommu_register_group(tbl, phb->hose->global_number, pe->pe_number); 676 676 677 677 if (pe->pdev) 678 678 set_iommu_table_base_and_group(&pe->pdev->dev, tbl); ··· 800 800 tbl->it_type |= (TCE_PCI_SWINV_CREATE | TCE_PCI_SWINV_FREE); 801 801 } 802 802 iommu_init_table(tbl, phb->hose->node); 803 - iommu_register_group(tbl, pci_domain_nr(pe->pbus), pe->pe_number); 803 + iommu_register_group(tbl, phb->hose->global_number, pe->pe_number); 804 804 805 805 if (pe->pdev) 806 806 set_iommu_table_base_and_group(&pe->pdev->dev, tbl);