]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: xhci: pet watchdog during transfers
authorGodfrey Mwangi <godmwan@microsoft.com>
Fri, 4 Aug 2023 19:00:39 +0000 (12:00 -0700)
committerMarek Vasut <marex@denx.de>
Mon, 14 Oct 2024 20:17:17 +0000 (22:17 +0200)
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 <godmwan@microsoft.com>
Reviewed-by: Marek Vasut <marex@denx.de>
drivers/usb/host/xhci-ring.c

index 68cf08e0b6b99d75e01aa657a3c97e2f1c91208e..34eb4536f0eab5923bb6a395fcfb8ba87344577c 100644 (file)
@@ -17,6 +17,7 @@
 #include <log.h>
 #include <asm/byteorder.h>
 #include <usb.h>
+#include <watchdog.h>
 #include <asm/unaligned.h>
 #include <linux/bug.h>
 #include <linux/errno.h>
@@ -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);