Skip to contentSkip to conversation

usb: xhci: pet watchdog during transfers

PATCH In review [email protected] 2 participants 2 messages Aug 4, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: xhci: pet watchdog during transfers

From: Godfrey Mwangi <[email protected]>

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.

---
 drivers/usb/host/xhci-ring.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/usb/host/xhci-ring.c +3 -0
index c8260cbdf9..de954314bc 100644
@@ -18,6 +18,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>
@@ -758,6 +759,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);
Signature · 1 line
2.40.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · On 8/4/23 21:00, [email protected] wrote:

From: Godfrey Mwangi <[email protected]>

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.

---
  drivers/usb/host/xhci-ring.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/usb/host/xhci-ring.c +1 -0
index c8260cbdf9..de954314bc 100644
@@ -18,6 +18,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>

drivers/usb/host/xhci-ring.c int xhci_bulk_tx(struct usb_device *udev, unsigned long pipe, · line 766

Quoted 8 lines
drivers/usb/host/xhci-ring.c +2 -0
@@ -758,6 +759,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);

s@pet@ping@ or trigger .

With that fixed:

Thanks !