PCI: hv: Properly handle PCI bus remove
authorLong Li <longli@microsoft.com>
Thu, 23 Mar 2017 21:58:10 +0000 (14:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Mar 2018 08:17:42 +0000 (09:17 +0100)
commitfd15bade786ee8d2db6fe45b5b7784a1ec9ca2b7
treec5a0740b7b344f460e3b5e10b5d1eb0eb3f1d243
parentae34475dfc0d6ad8c0b5cb25ab43a612ef223fb6
PCI: hv: Properly handle PCI bus remove

[ Upstream commit d3a78d8bf759d8848339dcc367c4c1678b57a08b ]

hv_pci_devices_present() is called in hv_pci_remove() when we remove a PCI
device from the host, e.g., by disabling SR-IOV on a device.  In
hv_pci_remove(), the bus is already removed before the call, so we don't
need to rescan the bus in the workqueue scheduled from
hv_pci_devices_present().

By introducing bus state hv_pcibus_removed, we can avoid this situation.

Reported-by: Xiaofeng Wang <xiaofwan@redhat.com>
Signed-off-by: Long Li <longli@microsoft.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/host/pci-hyperv.c