On 20/11/2019 12:28, Oliver O'Halloran wrote: > Signed-off-by: Oliver O'Halloran <ooh...@gmail.com> > --- > arch/powerpc/platforms/powernv/pci-ioda.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c > b/arch/powerpc/platforms/powernv/pci-ioda.c > index 4f38652c7cd7..8525642b1256 100644 > --- a/arch/powerpc/platforms/powernv/pci-ioda.c > +++ b/arch/powerpc/platforms/powernv/pci-ioda.c > @@ -3562,14 +3562,14 @@ static void pnv_ioda_release_pe(struct pnv_ioda_pe > *pe) > static void pnv_pci_release_device(struct pci_dev *pdev) > { > struct pnv_phb *phb = pci_bus_to_pnvhb(pdev->bus); > + struct pnv_ioda_pe *pe = pnv_ioda_get_pe(pdev); > struct pci_dn *pdn = pci_get_pdn(pdev); > - struct pnv_ioda_pe *pe; > > /* The VF PE state is torn down when sriov_disable() is called */ > if (pdev->is_virtfn) > return; > > - if (!pdn || pdn->pe_number == IODA_INVALID_PE) > + if (WARN_ON(!pe)) Is that WARN_ON because there is always a PE - from upstream bridge or a reserved one? > return; > > /* > @@ -3588,7 +3588,6 @@ static void pnv_pci_release_device(struct pci_dev *pdev) > * be increased on adding devices. It leads to unbalanced PE's device > * count and eventually make normal PCI hotplug path broken. > */ > - pe = &phb->ioda.pe_array[pdn->pe_number]; > pdn->pe_number = IODA_INVALID_PE; > > WARN_ON(--pe->device_count < 0); > -- Alexey
- [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
- Re: [Very RFC 38/46] powerpc/pci-hotplug: Scan t... Alexey Kardashevskiy
- [Very RFC 39/46] powernv/npu: Avoid pci_dn when mappi... Oliver O'Halloran
- Re: [Very RFC 39/46] powernv/npu: Avoid pci_dn w... Alexey Kardashevskiy
- [Very RFC 40/46] powernv/npu: Don't drop refcount whe... Oliver O'Halloran