From nobody Tue May 3 19:45:56 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 CA4051ACC910; Tue, 3 May 2022 19:45:56 +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 4Kt9S42NSwz4VRK; Tue, 3 May 2022 19:45:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651607156; 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=9xqKTODmTFhJi9nEr/kJIlL3PVZY8/5d2rtTR6dEJh4=; b=LihBkHwh3Wu0PUjsTQITlkFn9imbMLQkODmdZcPsKCYbR02uQGmtpVyFRNSQli+U/0+fAO PVJQ/mG66i+av1ICQKfDWlhJ1FQP6IlfloaByoIMj9a27McJV1sOr59vNSBfm8Z/QFytzu 77l9wO3hfNQ5F+6bTpXMtLBMSpYdeiFEtA1rIVerwDdIzAKj70lxn+ceQfVRcJ0Slb89FZ bPBVpKab7jTpi1qAl/u4tYKd40NRlTAMb1HesbPLK+4QXdZ84XCISOGmTrqPGs72HQ1VFT PG9Rhxc3zsDiy5uVFZRjWxt+ojjOAFs9O1fhlXgsMU7nhguVuHAo/+u/Li+PIQ== 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 316FC24941; Tue, 3 May 2022 19:45:56 +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 243Jju6t039593; Tue, 3 May 2022 19:45:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 243JjuWY039592; Tue, 3 May 2022 19:45:56 GMT (envelope-from git) Date: Tue, 3 May 2022 19:45:56 GMT Message-Id: <202205031945.243JjuWY039592@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: 610528736f3f - stable/13 - xhci(4): Only drop BULK and INTERRUPT endpoints to reset data toggle. 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: 610528736f3f0bf51f990dd93c5061a7a437e519 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651607156; 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=9xqKTODmTFhJi9nEr/kJIlL3PVZY8/5d2rtTR6dEJh4=; b=H0k5QQ4hAJxMJcVgCyrOAQJwpXpoygvqF05VHplD9VkbGwETwpPf0unqRunHpKUgmkHhef 7mN8iWeUT9EQBWrGq0vsZTt08KUi4esLQTAL2RzYTaqIB8HjHnuAu46YBQ4PqSWRI9eMPs 0q8M4ayIscedhtV7EXAfzI8/i2SQNTOqJz83rqd9L2pHdJpxBo+iWATIilWj8nit4kVVyd lPjdEqhmQMTHuNEYfXyF52EGkOzqdNdylcEmvi83UOitJVwd+8ul7Pu0GcqsVerWT4yfX3 wYFD/Uep+jttukpFRKhGDDCaBdLE0a+Ss3TsRFX0KkqT7kRgsNJmdrknhC0k5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651607156; a=rsa-sha256; cv=none; b=mweCe7J3+SLfxf7Z3/qpl1cE26izwh1f13qPoG0ett7GL/d2EsSl1iNLOVsKAOmCOt9MPe SvAismXtCwyCxvbTLTJ4TUhnAVeDAjXOEtvUzKf0rAsFf0XE6OzWD30MzmcbpfFufYfqR9 hZBGnYzzaCapbmAo93P0Bq5JbpWrJ6AB5g098jvESJBOP3SQ5iM5CNWR2HYbBDAP/Qdt6j WDbUtCdoB8RYOo9PG5yKzyBUH6uaaBNaW7EJn6523gFS+6lWhzY7tB04zcFIMwHsRwLHIp EdwA2ic2mJcnlGLO2GgcNhG1F55+5vPly619eRnS0eGNhnAsWvoQtvcTyeXkOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=610528736f3f0bf51f990dd93c5061a7a437e519 commit 610528736f3f0bf51f990dd93c5061a7a437e519 Author: Hans Petter Selasky AuthorDate: 2022-05-03 16:09:17 +0000 Commit: Hans Petter Selasky CommitDate: 2022-05-03 19:41:51 +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. While at it fix some whitespace. Tested by: ehaupt@ PR: 262882 Approved by: re (gjb, early MFC) 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 3d551eab2d44..9e812edae991 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -3898,9 +3898,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 "