[Very RFC 30/46] powernv/pci: Remove open-coded PE lookup in PELT-V teardown
Alexey Kardashevskiy
aik at ozlabs.ru
Wed Nov 27 15:50:34 AEDT 2019
On 20/11/2019 12:28, Oliver O'Halloran wrote:
> Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
> ---
> arch/powerpc/platforms/powernv/pci-ioda.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
> index 5bd7c1b058da..d4b5ee926222 100644
> --- a/arch/powerpc/platforms/powernv/pci-ioda.c
> +++ b/arch/powerpc/platforms/powernv/pci-ioda.c
> @@ -853,11 +853,13 @@ static int pnv_ioda_deconfigure_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe)
>
> /* Release from all parents PELT-V */
> while (parent) {
> - struct pci_dn *pdn = pci_get_pdn(parent);
> - if (pdn && pdn->pe_number != IODA_INVALID_PE) {
> - rc = opal_pci_set_peltv(phb->opal_id, pdn->pe_number,
> - pe->pe_number, OPAL_REMOVE_PE_FROM_DOMAIN);
> - /* XXX What to do in case of error ? */
May be print a warning, like a few lines below (in the code, not in the
patch). Not important though if gcc does not complain about an unused
returned value.
Reviewed-by: Alexey Kardashevskiy <aik at ozlabs.ru>
> + struct pnv_ioda_pe *parent_pe = pnv_ioda_get_pe(parent);
> +
> + if (parent_pe) {
> + rc = opal_pci_set_peltv(phb->opal_id,
> + parent_pe->pe_number,
> + pe->pe_number,
> + OPAL_REMOVE_PE_FROM_DOMAIN);
> }
> parent = parent->bus->self;
> }
>
--
Alexey
More information about the Linuxppc-dev
mailing list