diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2013-01-14 10:25:13 -0700 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-01-14 10:25:13 -0700 |
commit | d712f686ced38e248e510cc6b6f9498791f874cc (patch) | |
tree | bb181f33812564bcfc5b3b4e862daec680774276 /drivers/pci/hotplug/pciehp_hpc.c | |
parent | a82b6af37d20bfe6e99a4d890f1cf1d89059929f (diff) | |
parent | f652e7d2916fe2fcf9e7d709aa5b7476b431e2dd (diff) |
Merge branch 'pci/yijing-hotplug-workqueues' into for-linus
* pci/yijing-hotplug-workqueues:
PCI: shpchp: Use per-slot workqueues to avoid deadlock
PCI: shpchp: Handle push button event asynchronously
PCI: shpchp: Make shpchp_wq non-ordered
PCI: pciehp: Use per-slot workqueues to avoid deadlock
Diffstat (limited to 'drivers/pci/hotplug/pciehp_hpc.c')
-rw-r--r-- | drivers/pci/hotplug/pciehp_hpc.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 13b2eaf7ba43..5127f3f41821 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -773,23 +773,32 @@ static void pcie_shutdown_notification(struct controller *ctrl) static int pcie_init_slot(struct controller *ctrl) { struct slot *slot; + char name[32]; slot = kzalloc(sizeof(*slot), GFP_KERNEL); if (!slot) return -ENOMEM; + snprintf(name, sizeof(name), "pciehp-%u", PSN(ctrl)); + slot->wq = alloc_workqueue(name, 0, 0); + if (!slot->wq) + goto abort; + slot->ctrl = ctrl; mutex_init(&slot->lock); INIT_DELAYED_WORK(&slot->work, pciehp_queue_pushbutton_work); ctrl->slot = slot; return 0; +abort: + kfree(slot); + return -ENOMEM; } static void pcie_cleanup_slot(struct controller *ctrl) { struct slot *slot = ctrl->slot; cancel_delayed_work(&slot->work); - flush_workqueue(pciehp_wq); + destroy_workqueue(slot->wq); kfree(slot); } |