PCI/Hotplug: Schedule device add retries
PATCH 1/1 PCI/Hotplug: Schedule device add retries
If a device fails to be added after being hot inserted, it could be due to a power fault seen during the insertion or a failure to configure the new device. The devices are then removed from the tree and the slot disabled. Many times the devices are working as expected, but the slot could not tolerate the add without a power fault. A user then has to issue a sysfs rescan to re-add the slot and pick up the new devices.
This patch detects the failure during slot enabling and attempts to re-enable the slot a few more times before failing the slot. This fixes an issue where a power fault is seen during hot insertion, but the slot itself just needed some time for the power faults to quiesce before the device was ready to be used.
---
Applies against helgaas/pci/hotplug
drivers/pci/hotplug/pciehp.h | 1 + drivers/pci/hotplug/pciehp_ctrl.c | 45 ++++++++++++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 10 deletions(-)
drivers/pci/hotplug/pciehp.h +1 -0
@@ -93,6 +93,7 @@ struct controller {wait_queue_head_t queue;/* sleep & wake process */ u32 slot_cap;u16 slot_ctrl; +u8 slot_retries;struct timer_list poll_timer;unsigned long cmd_started;/* jiffies */ unsigned int cmd_busy:1;
drivers/pci/hotplug/pciehp_ctrl.c +35 -10
91 lines not on this page · raw message
Signature · 1 line
1.8.3.1