From nobody Wed May 04 07:29:25 2022 X-Original-To: dev-commits-src-branches@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 51CF611DC57D; Wed, 4 May 2022 07:29:25 +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 4KtT3n1kPPz3mLG; Wed, 4 May 2022 07:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651649365; 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=nx1oVP7SCZDfFhcqAjPocCeyO+W+JwtuFKTWJB8gJF8=; b=jgiMxne8EXt/IEgBm3MWuOFfRa0NP5tYWre3F4WnOqhTv3sE/18jNiy+BUYKfpxP2UHy1y eqXK3b+Y1MFUU/0c46BQSeWj9bADJQHMzZUEWjSRm4PL/RfyVJVIffTmg1vuLzgPnKTa8V qfTzDEnpgdSZWgPbeTCTJ2EaZQduRvaJprrNKQi4Sxuu2582z3duzJlHfkqqZfAnGpLkbM RPQMOe+N7u9NGqjXO6XIaTCgWYlH1dlTb9XcG0bgXlg+sZCC7Y0SH/uCYn9lSeCReHKSDY /A6Gs/Ffry3gZ68sTrr4QNHAJXse03M8W/ToS8Uhg5FGswcaWO5sdcjHrdg9fw== 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 1B53C6A7D; Wed, 4 May 2022 07:29:25 +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 2447TPTO084850; Wed, 4 May 2022 07:29:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2447TPTD084849; Wed, 4 May 2022 07:29:25 GMT (envelope-from git) Date: Wed, 4 May 2022 07:29:25 GMT Message-Id: <202205040729.2447TPTD084849@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: 473c925e4359 - stable/12 - xhci(4): Only drop BULK and INTERRUPT endpoints to reset data toggle. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 473c925e4359f79224374911cdeb1477bf1ef939 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651649365; 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=nx1oVP7SCZDfFhcqAjPocCeyO+W+JwtuFKTWJB8gJF8=; b=J8s/adK/CpsGAj3HdpRNYQveISwTuIosB/3nrjrgPDKatLrwfz+06e1Tt/psl7xqdJscd9 c5Qi2A4MtzttphjZLmdR0xK7fTRP8qBhu0gMJMMiZS9vtXf6yKvmgXXBCmO56PLYUP0RLh fSnTU2DwcSOnyNhTit1JdhMqW2upnEhYTp61zWy74ZVqx7whANkFAaynyO/AOqDPmQD5cd kv3ibGCd4ik5cgt5NgFjad7C2d+26xsDNM8SYcilLppIyEHLkWVlRqqsgsH+DvUYCVM8mm 7LaJPj7MDsgUPVMkIjQzRe1Hw4gXKA607X9xMVS34Z1Xad+Dx60sQr1asiJ9UQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651649365; a=rsa-sha256; cv=none; b=pphryFzZLmqrIBW6XWH5IY+p3dzgF9dlbkLdgDmVHQNlYYHWxwNf7wCZV73Hz5fT5k60Rl oFXyzaFxl2a+LL05pGu9cm92a9B0F8MVzv+BcH0zeNj/zyKAlZ7Hb/20allB+KGYSz7LyO WXVAFVUoE5zItA6bFnrBEx9DsDTddewKXQsoqemjQrZMy30zy2NEfj6wHgnA+sW6Jje7YN 9F3MbNER1kPW6Bo233aWxdXVdcs+LfhybtB5/ME8TOJ0XioDSxB1YGMbI+zxmG0vUy96I1 Kbfron7NWhBk1WJYVjyqmJfOdfxs5VrYHDSNM8SU7l6FfUKtXCtBx5gpNW4kag== 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=473c925e4359f79224374911cdeb1477bf1ef939 commit 473c925e4359f79224374911cdeb1477bf1ef939 Author: Hans Petter Selasky AuthorDate: 2022-05-03 16:09:17 +0000 Commit: Hans Petter Selasky CommitDate: 2022-05-04 07:28:41 +0000 xhci(4): Only drop BULK and INTERRUPT endpoints to reset data toggle. Only drop BULK and INTERRUPT endpoints, to reset the data toggle, because for other endpoint types this is not critical. Tested by: ehaupt@ PR: 262882 Sponsored by: NVIDIA Networking (cherry picked from commit e276d281503160ba3648bd394cde95736ee53329) --- sys/dev/usb/controller/xhci.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 3642b228b5c9..c2c111525e81 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -3932,9 +3932,16 @@ xhci_configure_reset_endpoint(struct usb_xfer *xfer) mask = (1U << epno); - if (epno != 1 && drop != 0) { + /* + * So-called control and isochronous transfer types have + * predefined data toggles (USB 2.0) or sequence numbers (USB + * 3.0) and does not need to be dropped. + */ + if (drop != 0 && + (edesc->bmAttributes & UE_XFERTYPE) != UE_CONTROL && + (edesc->bmAttributes & UE_XFERTYPE) != UE_ISOCHRONOUS) { /* drop endpoint context to reset data toggle value, if any. */ - xhci_configure_mask(udev, mask, 1); + xhci_configure_mask(udev, mask, 1); err = xhci_cmd_configure_ep(sc, buf_inp.physaddr, 0, index); if (err != 0) { DPRINTF("Could not drop "