From nobody Sun Apr 30 06:58:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HH21vyrz48sJq; Sun, 30 Apr 2023 06:58:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8HH15m7Jz3NN5; Sun, 30 Apr 2023 06:58:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4E6vmzzkE7k7nxpouVdBhmTC2VmaUUrBD40NNilZD/g=; b=OPPobscAXwQmEXcpXZqRvWYzVs/xIIIKP5/+UpOnqQVDoKS05TzLeROALtZI/kQU5Tj+9I AbZpEg0GnxBAmKMjnk7dbW9eKZS36tn5V1+pgqMRRdM/nkO+Nwlq7Y5LowlJXcs6jsDT0j WxSrQlAyIU+V16VqKGR7RH2c9JQk8KSCcPOYVa+ukW4QstBsZr++rFoVLdoFlvX1+pQJZs +pKDDFQH8EsalVW4hV68xHde9OUSOzWpeF5lj6LISYRmfiNjdKe2Ons5G1dAWIscunV3Fy XDR4opz3d5k7sCGsbmcPZ8aszSjMEMGFfG/RW+K1rS3xvl77xhfh6Gm2pP4F6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4E6vmzzkE7k7nxpouVdBhmTC2VmaUUrBD40NNilZD/g=; b=Y7m1zDZtjlKyV5nfWyHq7WOOicFtpeFt2GAAloGS05jAPMfFbwjwERIlFYV5/WmUAhSRnp Rf4ocI/Xmv7/3gcobQ96xpZEX3OB1vLoyc37frtc1EgD9tG1RMlYEReOqR6z5i+7RzAAp+ qwBAbL6VeLKXi9LAb4wuPX7QWH0e9KLIaZANGFyByzngbAP2DUiM+5HFpYeeTDv/zcZWAI 0vrbAfK19tav7SiHM3SVhjHgylU4c5EnGEIGlgEUNRkcy5fb4f3XkCjwWItZ954tfW9YzM rrbJgi7LH8hfbYal5OzVwb1ddafqsmRctdndYRmfiz3xKArV8XZP9paktX2OYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837885; a=rsa-sha256; cv=none; b=GhhCSSSKMDmCkSMOpj4PBrbBAbfk4bYNXMaH+1fs0ARS475JWDLhMXHC/ze0rMlRpLTxDU 59cVM0/Z4TX0g8kapJqbNOto841vvBSMRBP7y+33OgghNfij/fUaBlhoWyvGHBzJd6/ZuW ZWRnaGFAdhuDeeHvyuNroR3oTZwJ6GOOTqzQ5mJQznOLOs65CxbvBzk4iDqg3dPKjdPVZF JsK32D1Xn9MyNrRHpTh2dYIWiSDr3URf1yeaWrbQZ5HjQpvdRZAlVbaWdilDVErBiHWthP zsh+elAIwYiJCTkmdXpNgBcXNKN/poVN8FhMskc+qxSAyyHhcY35vf9+SlMzZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HH14qF6z1Crj; Sun, 30 Apr 2023 06:58:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33U6w5Or071766; Sun, 30 Apr 2023 06:58:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6w5Fh071764; Sun, 30 Apr 2023 06:58:05 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:05 GMT Message-Id: <202304300658.33U6w5Fh071764@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: fa65f958847d - stable/13 - Make sure the uftdi(4) driver doesn't start a USB transfer when being cancelled. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fa65f958847ddb89639b6502286607c774015dea Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=fa65f958847ddb89639b6502286607c774015dea commit fa65f958847ddb89639b6502286607c774015dea Author: Hans Petter Selasky AuthorDate: 2021-08-18 09:41:49 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:18 +0000 Make sure the uftdi(4) driver doesn't start a USB transfer when being cancelled. Sponsored by: NVIDIA Networking (cherry picked from commit 8a46f021c2408c82375a1f5127efb7ac6b78596e) --- sys/dev/usb/serial/uftdi.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/dev/usb/serial/uftdi.c b/sys/dev/usb/serial/uftdi.c index d57a2c5dbc45..5118a3affb84 100644 --- a/sys/dev/usb/serial/uftdi.c +++ b/sys/dev/usb/serial/uftdi.c @@ -1213,14 +1213,9 @@ uftdi_write_callback(struct usb_xfer *xfer, usb_error_t error) DPRINTFN(3, "\n"); switch (USB_GET_STATE(xfer)) { - default: /* Error */ - if (error != USB_ERR_CANCELLED) { - /* try to clear stall first */ - usbd_xfer_set_stall(xfer); - } - /* FALLTHROUGH */ case USB_ST_SETUP: case USB_ST_TRANSFERRED: +tr_setup: /* * If output packets don't require headers (the common case) we * can just load the buffer up with payload bytes all at once. @@ -1255,6 +1250,13 @@ uftdi_write_callback(struct usb_xfer *xfer, usb_error_t error) usbd_transfer_submit(xfer); } break; + default: /* Error */ + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; } }