summaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/pciehp_hpc.c
diff options
context:
space:
mode:
authorRajat Jain2014-02-05 03:31:11 +0100
committerBjorn Helgaas2014-02-12 00:13:16 +0100
commit50b52fdee050745935d92e7026373edea2647e60 (patch)
tree0739f5a0135b070c7626542ffd593074341d950b /drivers/pci/hotplug/pciehp_hpc.c
parentPCI: pciehp: Ensure very fast hotplug events are also processed (diff)
downloadkernel-qcow2-linux-50b52fdee050745935d92e7026373edea2647e60.tar.gz
kernel-qcow2-linux-50b52fdee050745935d92e7026373edea2647e60.tar.xz
kernel-qcow2-linux-50b52fdee050745935d92e7026373edea2647e60.zip
PCI: pciehp: Add hotplug_lock to serialize hotplug events
Today it is there is no protection around pciehp_enable_slot() and pciehp_disable_slot() to ensure that they complete before another hot-plug operation can be done on that particular slot. This patch introduces the slot->hotplug_lock to ensure that any hotplug operations (add / remove) complete before another hotplug event can begin processing on that particular slot. Signed-off-by: Rajat Jain <rajatxjain@gmail.com> Signed-off-by: Rajat Jain <rajatjain@juniper.net> Signed-off-by: Guenter Roeck <groeck@juniper.net> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/hotplug/pciehp_hpc.c')
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 6433e73aa2df..da4b0204b4f7 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -686,6 +686,7 @@ static int pcie_init_slot(struct controller *ctrl)
slot->ctrl = ctrl;
mutex_init(&slot->lock);
+ mutex_init(&slot->hotplug_lock);
INIT_DELAYED_WORK(&slot->work, pciehp_queue_pushbutton_work);
ctrl->slot = slot;
return 0;