• B
    Revert "PCI: Use hotplug-safe pci_get_domain_bus_and_slot()" · 94bb3464
    Bjorn Helgaas 提交于
    This reverts commit 433efd22.
    
    When we remove an SR-IOV device, we have this call chain:
    
        driver .remove() method
            pci_disable_sriov()
                sriov_disable()
                    virtfn_remove()
                        pci_get_domain_bus_and_slot()
    
    sriov_disable() is only called for PFs, not for VFs.  When it's called
    for a PF, it loops through all the VFs and calls virtfn_remove() for
    each.  But we stop and remove VFs before PFs, so by the time we get
    to virtfn_remove(), the VFs have already been stopped and deleted
    from the device list.  Now pci_get_domain_bus_and_slot(), which uses
    bus_find_device() and relies on that device list, doesn't find the
    VFs, so the VF references aren't released correctly.
    Reported-by: NYinghai Lu <yinghai@kernel.org>
    Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
    94bb3464
iov.c 16.6 KB