[RFC,V3,03/17] ppc/pci: don't unset pci resources for VFs

Submitted by Wei Yang on June 10, 2014, 1:56 a.m.


Message ID 1402365399-5121-4-git-send-email-weiyang@linux.vnet.ibm.com
State Superseded
Headers show

Commit Message

Wei Yang June 10, 2014, 1:56 a.m.
When the PCI_REASSIGN_ALL_RSRC is set, each resource for a pci_dev will be
unset. which means the pci core will reassign those resources.

While this behavior will clean up the resources information for VFs, whose
value is calculated in virtfn_add.

This patch adds a condition. If the pci_dev is a VF, skip the resource
unset process.

Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
 arch/powerpc/kernel/pci-common.c |    6 ++++++
 1 file changed, 6 insertions(+)

Patch hide | download patch | download mbox

diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index d9476c1..c449a26 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -824,6 +824,12 @@  static void pcibios_fixup_resources(struct pci_dev *dev)
+	if (dev->is_virtfn)
+		return;
 	for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
 		struct resource *res = dev->resource + i;
 		struct pci_bus_region reg;