OSDN Git Service

powerpc/pcidn: Make VF pci_dn management CONFIG_PCI_IOV specific
authorOliver O'Halloran <oohall@gmail.com>
Wed, 21 Aug 2019 06:26:54 +0000 (16:26 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 23 Jan 2020 10:31:19 +0000 (21:31 +1100)
commit8cd6aacc640116213f9373808a627ecd3728accc
tree61b847666cda66beb5abc3b6189a740bf958bbb6
parent1fb4124ca9d456656a324f1ee29b7bf942f59ac8
powerpc/pcidn: Make VF pci_dn management CONFIG_PCI_IOV specific

The powerpc PCI code requires that a pci_dn structure exists for all
devices in the system. This is fine for real devices since at boot a pci_dn
is created for each PCI device in the DT and it's fine for hotplugged devices
since the hotplug slot driver will manage the pci_dn's devices in hotplug
slots. For SR-IOV, we need the platform / pcibios to manage the pci_dn for
virtual functions since firmware is unaware of VFs, and they aren't
"hot plugged" in the traditional sense.

Management of the pci_dn is handled by the, poorly named, functions:
add_pci_dev_data() and remove_pci_dev_data(). The entire body of these
functions is #ifdef`ed around CONFIG_PCI_IOV and they cannot be used
in any other context, so make them only available when CONFIG_PCI_IOV
is selected, and rename them to reflect their actual usage rather than
having them masquerade as generic code.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Sam Bobroff <sbobroff@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190821062655.19735-2-oohall@gmail.com
arch/powerpc/include/asm/pci-bridge.h
arch/powerpc/kernel/pci_dn.c
arch/powerpc/platforms/powernv/pci-ioda.c
arch/powerpc/platforms/pseries/pci.c