From fe91450a596b558de31ae23f917e53201bc6b4c7 Mon Sep 17 00:00:00 2001 From: Godfrey Mwangi Date: Fri, 4 Aug 2023 12:00:39 -0700 Subject: [PATCH 1/2] usb: xhci: pet watchdog during transfers On some platforms with low USB throughput, tranfers of huge files take a long time and watchdog timer can expire resulting in hardware reset. Avoid this by petting the watchdog as long as we have pending transfers. Signed-off-by: Godfrey Mwangi Reviewed-by: Marek Vasut --- drivers/usb/host/xhci-ring.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 68cf08e0b6b..34eb4536f0e 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -796,6 +797,8 @@ int xhci_bulk_tx(struct usb_device *udev, unsigned long pipe, /* Calculate length for next transfer */ addr += trb_buff_len; trb_buff_len = min((length - running_total), TRB_MAX_BUFF_SIZE); + + schedule(); } while (running_total < length); giveback_first_trb(udev, ep_index, start_cycle, start_trb); From 3794bbf9e0e7ce2652935514cbfac49545c329a9 Mon Sep 17 00:00:00 2001 From: Bhupesh Sharma Date: Wed, 23 Aug 2023 21:11:23 +0530 Subject: [PATCH 2/2] usb: xhci: Define 'XHCI_MAX_HALT_USEC' macro only once Right now xhci header file defines XHCI_MAX_HALT_USEC macro twice. Fix the same. Cc: Bin Meng Signed-off-by: Bhupesh Sharma Reviewed-by: Marek Vasut --- include/usb/xhci.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/usb/xhci.h b/include/usb/xhci.h index 5fcdae1421f..ba065311df5 100644 --- a/include/usb/xhci.h +++ b/include/usb/xhci.h @@ -1134,8 +1134,6 @@ void xhci_hcd_stop(int index); /************************************************************* EXTENDED CAPABILITY DEFINITIONS *************************************************************/ -/* Up to 16 ms to halt an HC */ -#define XHCI_MAX_HALT_USEC (16*1000) /* HC not running - set to 1 when run/stop bit is cleared. */ #define XHCI_STS_HALT (1 << 0)