Use pci_lock_hotplug()/pci_unlock_hotplug() to serialize hotplug operations triggered by PCI hotplug sysfs interfaces. Signed-off-by: Jiang Liu <jiang.liu@xxxxxxxxxx> --- drivers/pci/hotplug/pci_hotplug_core.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c index 202f4a9..633fe3a 100644 --- a/drivers/pci/hotplug/pci_hotplug_core.c +++ b/drivers/pci/hotplug/pci_hotplug_core.c @@ -121,6 +121,7 @@ static ssize_t power_write_file(struct pci_slot *pci_slot, const char *buf, retval = -ENODEV; goto exit; } + pci_lock_hotplug(); switch (power) { case 0: if (slot->ops->disable_slot) @@ -136,6 +137,7 @@ static ssize_t power_write_file(struct pci_slot *pci_slot, const char *buf, err ("Illegal value specified for power\n"); retval = -EINVAL; } + pci_unlock_hotplug(); module_put(slot->ops->owner); exit: -- 1.7.5.4 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html