All of lore.kernel.org
 help / color / mirror / Atom feed
* [07/20] usb: host: xhci: use msecs_to_jiffies() instead of HZ
@ 2018-04-16 12:29 Felipe Balbi
  0 siblings, 0 replies; only message in thread
From: Felipe Balbi @ 2018-04-16 12:29 UTC (permalink / raw)
  To: Mathias Nyman; +Cc: Linux USB, Felipe Balbi

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

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
---
 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 {

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-16 12:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-16 12:29 [07/20] usb: host: xhci: use msecs_to_jiffies() instead of HZ Felipe Balbi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.