From nobody Sat Aug 27 06:53:28 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 4MF6qF0C33z4Zhdp; Sat, 27 Aug 2022 06:53:29 +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 4MF6qD6qX5z3b8K; Sat, 27 Aug 2022 06:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661583209; 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=zDQhipF8CRzeEAJBGLbtWScr1j2ary1CSkKWpS2POuM=; b=V3HeC6vFz4uvH6Z4U6WX1WG1gcNVTrDDQ4BiwATrRPaMPFdzSDsVe2+BYQ1PWg53qDOzE7 Q8sduqC1OqSVwErlPtNPwrwlUFt3rP52snvlkj4bNNzI3NTMpGumbD7HspCgoAiwPfWEPs hWQApSEn3gUIM9rz8aauN8X9CSUpkD8dfggf+RAqolAs60eVQm3PrHGKdkJFCggpWdsVId XjtoLrJ0wz+gHOO2+/Oaf+ml1yl48ppupAl80dWFyg8gwOiwI7/S0zXIl0X67+fSK5eKGO tHhrI3UpKGCB8ltHL9qarKM4OoklQpiosA9QhuDbzi1cIpwOZ+DAOrBhsf6SUA== 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 4MF6qD5tYpzgYp; Sat, 27 Aug 2022 06:53:28 +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 27R6rS0c074695; Sat, 27 Aug 2022 06:53:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27R6rSRu074694; Sat, 27 Aug 2022 06:53:28 GMT (envelope-from git) Date: Sat, 27 Aug 2022 06:53:28 GMT Message-Id: <202208270653.27R6rSRu074694@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 4e2d8cd3e29b - main - 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/main X-Git-Reftype: branch X-Git-Commit: 4e2d8cd3e29bc885567f61ff358f8c9459d621ce Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661583209; 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=zDQhipF8CRzeEAJBGLbtWScr1j2ary1CSkKWpS2POuM=; b=LBNa4McpgYtw/gW8oQgbKfbyjAt+e9CgB4/3EmQ0hxNG7DvAaU+sSqzftkFVkTvTdxAeZ9 o1o3vet//onOA+TSfkJMHl2cULiRY99x5B0QsFEn67Fi5FwbBHbJE1leAvpHs/XOrLdq/T 8S7xF+ikffp6YfDCUMyEfLv35+tQMY37zHexceC+0oo6+44y63+He/PHMX4e1MBboOZb62 cm/s2xMeBN4dy1eAG2Q4VP+IYIQh7ftdz4poQV+JvM/xZnlTWBYJhstVK2z1pd45LTg3rH MmuHJ5jAu7dhJBhzu8LY90RQ6R4QE0il911XahBPQvf4jcwwARaeCFNuO+S+TQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661583209; a=rsa-sha256; cv=none; b=aY7PIqq0CLr+GE+nYObrJej2f+hM0yYZ47Pb54V6CWvoOraliO2dq8ko84HKzY2aEXVFIB 458FMOpzQMe3OrRDKtLCM4vpMKe6Cix0hcZ+M1RpKCIPeBVa07wvsY7FOfB//2MQVlYFlj 1A1c6hQ7kAXW20FW9tbwi+W4+7I0zhnpCMv7PdlfOW/8Zn0x9gEMyNwHbCvtsz5qi0W1lZ nVLCKcq3pYx3iEfDnoWa5l0xHxebtYR8Km9rPtqDxNv14/w0ItI0CyF5KFLsNKho6/F0+C uKSZX64C1VX9mckW6xqKmzKGTerxRUm6XHVJJ9m9sjp0I+Msu6MK4zg8qJkPbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=4e2d8cd3e29bc885567f61ff358f8c9459d621ce commit 4e2d8cd3e29bc885567f61ff358f8c9459d621ce Author: Hans Petter Selasky AuthorDate: 2022-08-27 06:50:51 +0000 Commit: Hans Petter Selasky CommitDate: 2022-08-27 06:52:28 +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 MFC after: 1 week Sponsored by: NVIDIA Networking --- 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 a1781f3589a4..c5b370ccd31a 100644 --- a/sys/dev/usb/usb_request.c +++ b/sys/dev/usb/usb_request.c @@ -313,6 +313,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;