diff mbox

PCI: fix pcie_wait_cmd with poll mode timeout

Message ID 1408756512-16885-2-git-send-email-yinghai@kernel.org
State Accepted
Headers show

Commit Message

Yinghai Lu Aug. 23, 2014, 1:15 a.m. UTC
pcie_poll_cmd() take msecs instead of jiffies, need to convert
timeout to msecs.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 drivers/pci/hotplug/pciehp_hpc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

Comments

Bjorn Helgaas Sept. 23, 2014, 2:29 a.m. UTC | #1
On Fri, Aug 22, 2014 at 06:15:08PM -0700, Yinghai Lu wrote:
> pcie_poll_cmd() take msecs instead of jiffies, need to convert
> timeout to msecs.
> 
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>

Thanks for the fix.  I applied this to for-linus for v3.17, because it
fixes a change (40b960831cfa) that we merged for v3.17, and the bug may
cause us to wait less than we should before timing out and issuing a new
hotplug command.

> ---
>  drivers/pci/hotplug/pciehp_hpc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-2.6/drivers/pci/hotplug/pciehp_hpc.c
> ===================================================================
> --- linux-2.6.orig/drivers/pci/hotplug/pciehp_hpc.c
> +++ linux-2.6/drivers/pci/hotplug/pciehp_hpc.c
> @@ -160,7 +160,7 @@ static void pcie_wait_cmd(struct control
>  	    ctrl->slot_ctrl & PCI_EXP_SLTCTL_CCIE)
>  		rc = wait_event_timeout(ctrl->queue, !ctrl->cmd_busy, timeout);
>  	else
> -		rc = pcie_poll_cmd(ctrl, timeout);
> +		rc = pcie_poll_cmd(ctrl, jiffies_to_msecs(timeout));
>  
>  	/*
>  	 * Controllers with errata like Intel CF118 don't generate
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: linux-2.6/drivers/pci/hotplug/pciehp_hpc.c
===================================================================
--- linux-2.6.orig/drivers/pci/hotplug/pciehp_hpc.c
+++ linux-2.6/drivers/pci/hotplug/pciehp_hpc.c
@@ -160,7 +160,7 @@  static void pcie_wait_cmd(struct control
 	    ctrl->slot_ctrl & PCI_EXP_SLTCTL_CCIE)
 		rc = wait_event_timeout(ctrl->queue, !ctrl->cmd_busy, timeout);
 	else
-		rc = pcie_poll_cmd(ctrl, timeout);
+		rc = pcie_poll_cmd(ctrl, jiffies_to_msecs(timeout));
 
 	/*
 	 * Controllers with errata like Intel CF118 don't generate