• X
    PCI: Finish SR-IOV VF setup before adding the device · fbf33f51
    Xudong Hao 提交于
    Commit 4f535093 "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: NXudong Hao <xudong.hao@intel.com>
    Signed-off-by: NJiang Liu <jiang.liu@huawei.com>
    Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
    Cc: stable@vger.kernel.org	# v3.9+
    fbf33f51
iov.c 18.8 KB