You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
PCI: hotplug: Use global PCI rescan-remove locking
Multiple race conditions are possible between PCI hotplug and the generic PCI bus rescan and device removal that can be triggered via sysfs. To avoid those race conditions make PCI hotplug use global PCI rescan-remove locking. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
committed by
Bjorn Helgaas
parent
5ef68e8867
commit
c4ec84c7db
@@ -398,7 +398,9 @@ static int enable_slot(struct hotplug_slot *hotplug_slot)
|
||||
return retval;
|
||||
|
||||
if (state == PRESENT) {
|
||||
pci_lock_rescan_remove();
|
||||
pcibios_add_pci_devices(slot->bus);
|
||||
pci_unlock_rescan_remove();
|
||||
slot->state = CONFIGURED;
|
||||
} else if (state == EMPTY) {
|
||||
slot->state = EMPTY;
|
||||
@@ -418,7 +420,9 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
|
||||
if (slot->state == NOT_CONFIGURED)
|
||||
return -EINVAL;
|
||||
|
||||
pci_lock_rescan_remove();
|
||||
pcibios_remove_pci_devices(slot->bus);
|
||||
pci_unlock_rescan_remove();
|
||||
vm_unmap_aliases();
|
||||
|
||||
slot->state = NOT_CONFIGURED;
|
||||
|
||||
Reference in New Issue
Block a user