Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F765C001DE for ; Fri, 4 Aug 2023 19:00:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AAE6A86948; Fri, 4 Aug 2023 21:00:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="i5PwKeTy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DE39F86970; Fri, 4 Aug 2023 21:00:50 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by phobos.denx.de (Postfix) with ESMTP id D466F868C0 for ; Fri, 4 Aug 2023 21:00:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanedmond@linux.microsoft.com Received: from ovlvm106.redmond.corp.microsoft.com (unknown [131.107.147.185]) by linux.microsoft.com (Postfix) with ESMTPSA id DD8A2207F58A; Fri, 4 Aug 2023 12:00:47 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com DD8A2207F58A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1691175647; bh=XghauHsqE26SVqOxavNHXZaDUZD3UsTwswEBOjG/Y0g=; h=From:To:Cc:Subject:Date:From; b=i5PwKeTyEgb0iNKpLvRj8J0lXvEFe9np6q+A1w4s4K5781hEUJkmUVEWfAhD+9G7I HtE0qyFfx7VXT8wLCy3n+j07EZfr4szAOQV+5KSoymJwcfQs2MfEr55gB5Dl+XbQDE FK3rPEBXYNZw9z8gJEJPWZ3g94pNeaH5esb7jUCU= From: seanedmond@linux.microsoft.com To: u-boot@lists.denx.de Cc: bmeng.cn@gmail.com, marex@denx.de Subject: [PATCH] usb: xhci: pet watchdog during transfers Date: Fri, 4 Aug 2023 12:00:39 -0700 Message-Id: <20230804190039.72143-1-seanedmond@linux.microsoft.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Godfrey Mwangi 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 --- 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 c8260cbdf9..de954314bc 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -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); -- 2.40.0