During command writes, pcie_poll_cmd() is invoked if Command Completed notifications are disabled. When polling, if Command Completed is set, the bit is reset and success is returned, but ctrl->cmd_busy is not set back to 0. The next command write then attempts to wait on a command that has already been completed, timing out after 2 seconds. This delay occurs more frequently at boot time, since pcie_init() disables notifications when powering down empty slots. Clear cmd_busy upon successful command completion during pcie_poll_cmd(). Signed-off-by: Spencer Lingard <spencer@xxxxxxxxxxxx> Cc: Lukas Wunner <lukas@xxxxxxxxx> --- drivers/pci/hotplug/pciehp_hpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 6a2365c..28c70cf 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -77,6 +77,7 @@ static int pcie_poll_cmd(struct controller *ctrl, int timeout) if (slot_status & PCI_EXP_SLTSTA_CC) { pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, PCI_EXP_SLTSTA_CC); + ctrl->cmd_busy = 0; return 1; } if (timeout < 0) -- 2.1.2