diff options
-rw-r--r-- | drivers/pci/host/pci-hyperv.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c index 39fafda4deff..a1b3c1957d43 100644 --- a/drivers/pci/host/pci-hyperv.c +++ b/drivers/pci/host/pci-hyperv.c | |||
@@ -1209,9 +1209,11 @@ static int create_root_hv_pci_bus(struct hv_pcibus_device *hbus) | |||
1209 | hbus->pci_bus->msi = &hbus->msi_chip; | 1209 | hbus->pci_bus->msi = &hbus->msi_chip; |
1210 | hbus->pci_bus->msi->dev = &hbus->hdev->device; | 1210 | hbus->pci_bus->msi->dev = &hbus->hdev->device; |
1211 | 1211 | ||
1212 | pci_lock_rescan_remove(); | ||
1212 | pci_scan_child_bus(hbus->pci_bus); | 1213 | pci_scan_child_bus(hbus->pci_bus); |
1213 | pci_bus_assign_resources(hbus->pci_bus); | 1214 | pci_bus_assign_resources(hbus->pci_bus); |
1214 | pci_bus_add_devices(hbus->pci_bus); | 1215 | pci_bus_add_devices(hbus->pci_bus); |
1216 | pci_unlock_rescan_remove(); | ||
1215 | hbus->state = hv_pcibus_installed; | 1217 | hbus->state = hv_pcibus_installed; |
1216 | return 0; | 1218 | return 0; |
1217 | } | 1219 | } |
@@ -1612,8 +1614,10 @@ static void hv_eject_device_work(struct work_struct *work) | |||
1612 | pdev = pci_get_domain_bus_and_slot(hpdev->hbus->sysdata.domain, 0, | 1614 | pdev = pci_get_domain_bus_and_slot(hpdev->hbus->sysdata.domain, 0, |
1613 | wslot); | 1615 | wslot); |
1614 | if (pdev) { | 1616 | if (pdev) { |
1617 | pci_lock_rescan_remove(); | ||
1615 | pci_stop_and_remove_bus_device(pdev); | 1618 | pci_stop_and_remove_bus_device(pdev); |
1616 | pci_dev_put(pdev); | 1619 | pci_dev_put(pdev); |
1620 | pci_unlock_rescan_remove(); | ||
1617 | } | 1621 | } |
1618 | 1622 | ||
1619 | spin_lock_irqsave(&hpdev->hbus->device_list_lock, flags); | 1623 | spin_lock_irqsave(&hpdev->hbus->device_list_lock, flags); |