powerpc/pci: Create pci_dn for VFs
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Wed, 25 Mar 2015 08:23:52 +0000 (16:23 +0800)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 31 Mar 2015 02:02:37 +0000 (13:02 +1100)
commita8b2f8288a3fdef8d93efef2b1ead7563004275e
tree40f3d68896c56cb4e67b48d006f367eb28cf1b34
parentd74b9027a4dafa44d3a3c2a44ce135e50a13ec10
powerpc/pci: Create pci_dn for VFs

pci_dn is the extension of PCI device node and is created from device node.
Unfortunately, VFs are enabled dynamically by PF's driver and they don't
have corresponding device nodes and pci_dn, which is required to access
VFs' config spaces.

The patch creates pci_dn for VFs in pcibios_sriov_enable() on their PF,
and removes pci_dn for VFs in pcibios_sriov_disable() on their PF. When
VF's pci_dn is created, it's put to the child list of the pci_dn of PF's
upstream bridge. The pci_dn is linked to pci_dev during early fixup time
to setup the fast path.

[bhelgaas: add ifdef around add_one_dev_pci_info(), use dev_printk()]
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/pci-bridge.h
arch/powerpc/kernel/pci_dn.c
arch/powerpc/platforms/powernv/pci-ioda.c