[PATCH 07/20] usb: host: xhci: use msecs_to_jiffies() instead of HZ

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

 



HZ can change based on CPUFreq. We should use msecs_to_jiffies()
instead.

Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx>
---
 drivers/usb/host/xhci.c | 3 +--
 drivers/usb/host/xhci.h | 6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index eec9e0c0b7c9..663eac3c8a1b 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1505,8 +1505,7 @@ static int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
 			goto done;
 		}
 		ep->ep_state |= EP_STOP_CMD_PENDING;
-		ep->stop_cmd_timer.expires = jiffies +
-			XHCI_STOP_EP_CMD_TIMEOUT * HZ;
+		ep->stop_cmd_timer.expires = jiffies + XHCI_STOP_EP_CMD_TIMEOUT;
 		add_timer(&ep->stop_cmd_timer);
 		xhci_queue_stop_endpoint(xhci, command, urb->dev->slot_id,
 					 ep_index, 0);
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 05c909b04f14..d2d30cbbf53d 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1518,7 +1518,7 @@ struct xhci_td {
 };
 
 /* xHCI command default timeout value */
-#define XHCI_CMD_DEFAULT_TIMEOUT	(5 * HZ)
+#define XHCI_CMD_DEFAULT_TIMEOUT	(msecs_to_jiffies(5000))
 
 /* command descriptor */
 struct xhci_cd {
@@ -1630,8 +1630,8 @@ struct urb_priv {
 #define	ERST_ENTRIES	1
 /* Poll every 60 seconds */
 #define	POLL_TIMEOUT	60
-/* Stop endpoint command timeout (secs) for URB cancellation watchdog timer */
-#define XHCI_STOP_EP_CMD_TIMEOUT	5
+/* Stop endpoint command timeout (jiffies) for URB cancellation watchdog timer */
+#define XHCI_STOP_EP_CMD_TIMEOUT	(msecs_to_jiffies(5000))
 /* XXX: Make these module parameters */
 
 struct s3_save {
-- 
2.16.1

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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux