From a689bc6fa5ccfb20f524396a8b81887b54124cc3 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Wed, 17 Oct 2012 11:55:55 +0200 Subject: [PATCH] --- yaml --- r: 334781 b: refs/heads/master c: 8a5248fe10b101104d92d01438f918e899414fd1 h: refs/heads/master i: 334779: f7ca3d82cee9919fb6bd8b5e9d0b55c10a56062a v: v3 --- [refs] | 2 +- trunk/drivers/xen/xen-pciback/vpci.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 4a05b548c4c9..dc37dee25101 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e9d1aa05da264cf7e1906b81a90d6abfdbe3700b +refs/heads/master: 8a5248fe10b101104d92d01438f918e899414fd1 diff --git a/trunk/drivers/xen/xen-pciback/vpci.c b/trunk/drivers/xen/xen-pciback/vpci.c index 46d140baebd8..0f478ac483cd 100644 --- a/trunk/drivers/xen/xen-pciback/vpci.c +++ b/trunk/drivers/xen/xen-pciback/vpci.c @@ -89,9 +89,15 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev, mutex_lock(&vpci_dev->lock); - /* Keep multi-function devices together on the virtual PCI bus */ - for (slot = 0; slot < PCI_SLOT_MAX; slot++) { - if (!list_empty(&vpci_dev->dev_list[slot])) { + /* + * Keep multi-function devices together on the virtual PCI bus, except + * virtual functions. + */ + if (!dev->is_virtfn) { + for (slot = 0; slot < PCI_SLOT_MAX; slot++) { + if (list_empty(&vpci_dev->dev_list[slot])) + continue; + t = list_entry(list_first(&vpci_dev->dev_list[slot]), struct pci_dev_entry, list); @@ -116,7 +122,7 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev, pci_name(dev), slot); list_add_tail(&dev_entry->list, &vpci_dev->dev_list[slot]); - func = PCI_FUNC(dev->devfn); + func = dev->is_virtfn ? 0 : PCI_FUNC(dev->devfn); goto unlock; } }