From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796388413; b=QB0EE6enX43ZoC+N+P/R1MH2DH7sNJdZLkBrpwnSXtAyzCrto3jjN7bUEymMOpS+DyuE PfMFkLZAnvqr5k9ZRCpg4tvQPmA2ay1NhRMmXrYpwr20MScGOZc/EMLMw8ve2AXg0d6b2 oDuhP+oh6VcvhcxDnfWp6G62GSdIIvxotLVQaH4XDHN7VHv5DEslTULknNuDXpaTlQBfI y/ClqSDOHRUea5mspULl3O0bJ4boHkZY8pnUj0Qho5X5padEKVvxKBz03PniN30id4dk8 CQ55TfpdiMTraK0vNlpZLAnJSvxATdgT6Bj/sNfu2PXe9pVQUHarj3RYMDdvRtkFfKA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388413; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=Q7sktN2gHcUaaflaxbjM40/KzJ7yPQ3qYLUiMMGdxKk=; b=khWCKjw/FMGNH6PZhiFxMpVSI/hhIEWvzHMn8gcotYX2NAMuXDjh4EtdT3Gf4mjV/r8Y qyluulCws6c/Bx7QZrst7kn5zHvl0jsJfjhQPirdaMz3pbYe+/c7KHVVxkyWuhZlA8U0w pETjD5ZGrCG3ReKXuMk9HkBh8bhwxFsScL7FRNlsOYi6M3RkVLrRYxvUc4Eac+CU7JBBk SmofnqfKD+/BXX0DYNICS4U8UQRu1GJLZQ0XOAO35us0pIR1r/sdpkC5tsZEDn4kxlw3m lVRikEzVJbdV4XLLR7NNuuVMNTMSNYLCgfnqPwErNqoqKuECjk5iDlSxNe8yRRC6gqg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Gc6p6vjW; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 765B2606A32C; Fri, 4 Dec 2026 12:46:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Gc6p6vjW Received: by smtp.kernel.org (Postfix) with ESMTPSA id E60CF1F000CE; Fri, 4 Dec 2026 12:46:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388413; bh=Q7sktN2gHcUaaflaxbjM40/KzJ7yPQ3qYLUiMMGdxKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Gc6p6vjWRLN1nXdRJwsgpM8C3cw/I+TKXoOkPhDDyO7YuKapb/Nkc5z7NRxbPgA9z HjIMj2rhSDOypfot8CNakP2jxnPhTGPLiIAy1h9iiBhq6Ow5ZifONmH8v6B33XWGh9 KsnhwGNEA/49/bDAvQH7p4qMOQPZ+fZvCfQUZCU8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Thinh Nguyen , stable Subject: [PATCH 6.1 0603/1059] usb: dwc3: gadget: Recover from End Transfer timeout Date: Fri, 4 Dec 2026 19:02:14 +0900 Message-ID: <20261204100659.743234161@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thinh Nguyen commit 61575534fb05d52d36979f38976ece74649f091a upstream. If the End Transfer command times out, the endpoint resource is never released and every subsequent Start Transfer to the endpoint fails with "No Resource". Schedule an error recovery to reset the controller. Signed-off-by: Thinh Nguyen Cc: stable Link: https://patch.msgid.link/7523e9a11303a33acd0b92a092fb0e8218d509d2.1792542945.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/gadget.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1702,6 +1702,8 @@ static int __dwc3_gadget_get_frame(struc return DWC3_DSTS_SOFFN(reg); } +static void dwc3_schedule_err_recovery(struct dwc3 *dwc); + /** * __dwc3_stop_active_transfer - stop the current active transfer * @dep: isoc endpoint @@ -1740,6 +1742,9 @@ static int __dwc3_stop_active_transfer(s dev_err_ratelimited(dep->dwc->dev, "end transfer failed: %d\n", ret); + if (ret == -ETIMEDOUT && dep->dwc->err_state == DWC3_ERR_NONE) + dwc3_schedule_err_recovery(dep->dwc); + dep->resource_index = 0; if (!interrupt)