On 20/11/2019 12:28, Oliver O'Halloran wrote: > Signed-off-by: Oliver O'Halloran <ooh...@gmail.com> > --- > arch/powerpc/platforms/powernv/pci.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/arch/powerpc/platforms/powernv/pci.c > b/arch/powerpc/platforms/powernv/pci.c > index 5b1f4677cdce..0eeea8652426 100644 > --- a/arch/powerpc/platforms/powernv/pci.c > +++ b/arch/powerpc/platforms/powernv/pci.c > @@ -943,23 +943,22 @@ static int pnv_tce_iommu_bus_notifier(struct > notifier_block *nb, > { > struct device *dev = data; > struct pci_dev *pdev; > - struct pci_dn *pdn; > struct pnv_ioda_pe *pe; > struct pnv_phb *phb; > > switch (action) { > case BUS_NOTIFY_ADD_DEVICE: > pdev = to_pci_dev(dev); > - pdn = pci_get_pdn(pdev); > phb = pci_bus_to_pnvhb(pdev->bus); > > WARN_ON_ONCE(!phb); > - if (!pdn || pdn->pe_number == IODA_INVALID_PE || !phb) > + if (!phb) > return 0; This check is weird - the function does not use @phb anymore, it would make more sense if pnv_ioda_get_pe() checked phb!=NULL. > > - pe = &phb->ioda.pe_array[pdn->pe_number]; > - if (!pe->table_group.group) > + pe = pnv_ioda_get_pe(pdev); > + if (!pe || !pe->table_group.group) > return 0; > + > iommu_add_device(&pe->table_group, dev); > return 0; > case BUS_NOTIFY_DEL_DEVICE: > -- Alexey
- [Very RFC 29/46] powernv/pci: Remove open-coded PE lo... Oliver O'Halloran
- Re: [Very RFC 29/46] powernv/pci: Remove open-co... Alexey Kardashevskiy
- [Very RFC 30/46] powernv/pci: Remove open-coded PE lo... Oliver O'Halloran
- Re: [Very RFC 30/46] powernv/pci: Remove open-co... Alexey Kardashevskiy
- [Very RFC 31/46] powernv/pci: Remove open-coded PE lo... Oliver O'Halloran
- Re: [Very RFC 31/46] powernv/pci: Remove open-co... Christoph Hellwig
- Re: [Very RFC 31/46] powernv/pci: Remove open-co... Alexey Kardashevskiy
- [Very RFC 32/46] powernv/pci: Remove open-coded PE lo... Oliver O'Halloran
- Re: [Very RFC 32/46] powernv/pci: Remove open-co... Alexey Kardashevskiy
- [Very RFC 33/46] powernv/pci: Remove open-coded PE lo... Oliver O'Halloran
- Re: [Very RFC 33/46] powernv/pci: Remove open-co... Alexey Kardashevskiy
- [Very RFC 34/46] powernv/pci: Remove open-coded PE lo... Oliver O'Halloran
- Re: [Very RFC 34/46] powernv/pci: Remove open-co... Alexey Kardashevskiy
- [Very RFC 35/46] powernv/pci: Remove open-coded PE lo... Oliver O'Halloran
- Re: [Very RFC 35/46] powernv/pci: Remove open-co... Alexey Kardashevskiy
- Re: [Very RFC 35/46] powernv/pci: Remove ope... Oliver O'Halloran
- [Very RFC 36/46] powernv/npu: Remove open-coded PE lo... Oliver O'Halloran
- Re: [Very RFC 36/46] powernv/npu: Remove open-co... Alexey Kardashevskiy
- [Very RFC 37/46] powernv/pci: Use the PHB's rmap for ... Oliver O'Halloran
- Re: [Very RFC 37/46] powernv/pci: Use the PHB's ... Alexey Kardashevskiy
- [Very RFC 38/46] powerpc/pci-hotplug: Scan the whole ... Oliver O'Halloran