[PATCH] PCI: pciehp: Use ordered workqueue for HPC events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Using an ordered workqueue serializes processing of hotplug event. Processing
an hotplug event for some devices can take a relatively "long" time, which
means if a device is added and removed in quick succession (or due to flacky
hardware), it can lead to multiple outstanding hotplug events. Processing
these events concurrently can lead to unknown internal state and/or kernel
panics.

Signed-off-by: Sandeep Mann <sandeep@xxxxxxxxxxxxxxx>
---
 drivers/pci/hotplug/pciehp_hpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 42914e0..c4eedab 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -681,7 +681,7 @@ static int pcie_init_slot(struct controller *ctrl)
 	if (!slot)
 		return -ENOMEM;
 
-	slot->wq = alloc_workqueue("pciehp-%u", 0, 0, PSN(ctrl));
+	slot->wq = alloc_ordered_workqueue("pciehp-%u", 0, PSN(ctrl));
 	if (!slot->wq)
 		goto abort;
 
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux