]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/eeh: Move vf_index out of pci_dn and into eeh_dev
authorOliver O'Halloran <oohall@gmail.com>
Sat, 25 Jul 2020 08:12:20 +0000 (18:12 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 26 Jul 2020 13:34:20 +0000 (23:34 +1000)
commitd7224fd77da1fb235b07a0ef77b26d32d4a0f34a
treeb163e1f157c1ac4fbcd203f5aedea50f497c2cc3
parent94fd2e2bb6c0d6da3e3ac3cbbdd9038ff33035e1
powerpc/eeh: Move vf_index out of pci_dn and into eeh_dev

Drivers that do not support the PCI error handling callbacks are handled by
tearing down the device and re-probing them. If the device being removed is
a virtual function then we need to know the VF index so it can be removed
using the pci_iov_{add|remove}_virtfn() API.

Currently this is handled by looking up the pci_dn, and using the vf_index
that was stashed there when the pci_dn for the VF was created in
pcibios_sriov_enable(). We would like to eliminate the use of pci_dn
outside of pseries though so we need to provide the generic EEH code with
some other way to find the vf_index.

The easiest thing to do here is move the vf_index field out of pci_dn and
into eeh_dev.  Currently pci_dn and eeh_dev are allocated and initialized
together so this is a fairly minimal change in preparation for splitting
pci_dn and eeh_dev in the future.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200725081231.39076-3-oohall@gmail.com
arch/powerpc/include/asm/eeh.h
arch/powerpc/include/asm/pci-bridge.h
arch/powerpc/kernel/eeh_driver.c
arch/powerpc/kernel/pci_dn.c