From nobody Sat Sep 03 10:23:03 2022 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 4MKW7r12WXz4bw5c; Sat, 3 Sep 2022 10:23:04 +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 4MKW7r0XWQz41lb; Sat, 3 Sep 2022 10:23:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662200584; 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=PWjmz8PRcaMxhtY9Ez1CKvum+D5lRZxKf0hz8tL/u4Y=; b=w0DAn2IzQ/Fpb0ter2Fg3DpV2CHbkLI5LZpr8vU78vxQaVRPmsiYaK2IuWu8SVsxZ5i7Zo V1sSIaXRwhsEAaHKRjz/e0gCCh2hqTV+xMqltYgA+q6I5gOul9aTKyjA56xeQyiRHF6Gpj fVldQ77azwIpeFoHDRcK+rwoNhc/uc8ZBXuDXYFZtkFgkkIkzRjrSvh/xd48SNV+Rhp3hj 0ky7NE18G3mo4N45L4Bw1s8V0OK9kw144tLPRglt0hdz2TuRZ2GgGM8GH0D7Ff8x1dlFIl Z5japiRQ8YGxZE1awZ68t7POj+QP/hHavMeus1bo6Df3L3MOogCbiTH8s8gJBw== 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 4MKW7q6jgJz16wT; Sat, 3 Sep 2022 10:23:03 +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 283AN3Y1073189; Sat, 3 Sep 2022 10:23:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 283AN3gv073188; Sat, 3 Sep 2022 10:23:03 GMT (envelope-from git) Date: Sat, 3 Sep 2022 10:23:03 GMT Message-Id: <202209031023.283AN3gv073188@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: 069662d05f73 - stable/12 - usb(4): Quirk for non-compliant USB devices. 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/12 X-Git-Reftype: branch X-Git-Commit: 069662d05f730453cd8968e237ba540840c6a163 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662200584; 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=PWjmz8PRcaMxhtY9Ez1CKvum+D5lRZxKf0hz8tL/u4Y=; b=ytMIXoxDCzW3Fzqz3gmFQeJTo8lNNxYF+voFvLkVvMlwWq5AhyDAy2BNcxQ+vyzqDsJxkC bVddYrOFikZecsBHy6mVo2g4bgN7P9GlFyOMpu2fDFID8v6pi7dceLDoFFOxCChpAk1vuV C0zOU2RV0JzsV5chAVdH7wmjmd7QsQv8qJhxi/mppQmHyjCM5roH2yveH+TM3Mgs1wnx5U lGs030xFim7ABdTpWW6H90uodtkAp+immFQdelq8rQWnl86IKXlxi62YXrseNhkx0PUK5d jBtSShWrLhlNLPbQPF5OhqIR+cv5PGcajjdDpf7fY4tZkoDMWO1A7jnkzoqv3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662200584; a=rsa-sha256; cv=none; b=Do8phk1GmowMpFDZ4f/MO6Rmr1TucbL/b8yV11MOTsMljnkuILPtG+c8wTSjL37GHBOLcR 7gvwOxGiCaZWc11zmKqB0v9ejkIBqijMvUfwWC+rt+lL8a67GsS1qtr2nBKZen44BcyLEW CKZvNevGVUyeW89tnjNYFreduxRiCj6R5+GYsW/3o1cWLfRMdI0xoKWkJi9xJU60cnsxH4 lvsaC1m8D8rY4FZjo5JV59FsSnt9Zk9JKajSnrpahFMyTg6vjJY3sOfGUwkOb8fihpY7jT ujei65Yc8K8XCISqM+1PsdWeB+/IGhi1DCV83xCuIISey65d7NdCmRTwC8jfHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=069662d05f730453cd8968e237ba540840c6a163 commit 069662d05f730453cd8968e237ba540840c6a163 Author: Hans Petter Selasky AuthorDate: 2022-08-27 06:50:51 +0000 Commit: Hans Petter Selasky CommitDate: 2022-09-03 10:22:29 +0000 usb(4): Quirk for non-compliant USB devices. Some non-compliant USB devices do not implement the clear endpoint halt feature. Silently ignore such failures, when they at least responded correctly passing up a valid STALL PID packet. Tested by: Doug Ambrisko Sponsored by: NVIDIA Networking (cherry picked from commit 4e2d8cd3e29bc885567f61ff358f8c9459d621ce) --- sys/dev/usb/usb_request.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/dev/usb/usb_request.c b/sys/dev/usb/usb_request.c index 13117c0b9c77..cb05a8b6308a 100644 --- a/sys/dev/usb/usb_request.c +++ b/sys/dev/usb/usb_request.c @@ -314,6 +314,16 @@ tr_setup: */ if (usb_no_cs_fail) goto tr_transferred; + + /* + * Some non-compliant USB devices do not implement the + * clear endpoint halt feature. Silently ignore such + * devices, when they at least respond correctly + * passing up a valid STALL PID packet. + */ + if (error == USB_ERR_STALLED) + goto tr_transferred; + if (udev->clear_stall_errors == USB_CS_RESET_LIMIT) goto tr_setup;