]> git.ipfire.org Git - people/arne_f/kernel.git/commit
PCI: Finish SR-IOV VF setup before adding the device
authorXudong Hao <xudong.hao@intel.com>
Fri, 31 May 2013 04:21:29 +0000 (12:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Jul 2013 00:16:08 +0000 (17:16 -0700)
commit1eadb07a8d01b5c2ae323cef29276440627fc7f1
treeadd1ce940e23280b0f6fa1bb9ddb01472e5d4f1c
parent0fa759d293854180e00571def0752eeda880c72e
PCI: Finish SR-IOV VF setup before adding the device

commit fbf33f516bdbcc2ab1ba1e54dfb720b0cfaa6874 upstream.

Commit 4f535093cf "PCI: Put pci_dev in device tree as early as possible"
moves device registering from pci_bus_add_devices() to pci_device_add().
That causes problems for virtual functions because device_add(&virtfn->dev)
is called before setting the virtfn->is_virtfn flag, which then causes Xen
to report PCI virtual functions as PCI physical functions.

Fix it by setting virtfn->is_virtfn before calling pci_device_add().

[Jiang Liu]: Move the setting of virtfn->is_virtfn ahead further for better
readability and modify changelog.

Signed-off-by: Xudong Hao <xudong.hao@intel.com>
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/iov.c