From nobody Tue May 03 16:14:52 2022 X-Original-To: dev-commits-src-main@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 11F2D1AB3F9B; Tue, 3 May 2022 16:14:53 +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 4Kt4mX73Zfz4gsP; Tue, 3 May 2022 16:14:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651594493; 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=a+hz7o7m2CO51nk2Us4v1PCoCu1F40DqqtGcAFU86rY=; b=iad9Dlx/AQpQ2XZgHwCDMjQ1N9iT+qRzkCAXEjJugnMliRrh5ecMkokGo5pvrciUlNCgvC gMKa6dZ7d1w/n2GA+CQ0hsTVQD7L4NwNrjqgg2YBa6jiEqNi0jr02n73drVEnpW8hkgQIg 1R5MWOoCqnHhGu7aqMSd80PkzNrePqQ+AJrIF3lSCD6Ew0uTAe4Gj2FgfmXYKPg92Je1gB 0jxaGLwmmxzSXwNpTNSpf6RdF5pgrGx62pfVL2vxKz4pT/LRaAu0Fdb/a36PbanDsxUpX3 a5PqC42TyrpOQIvbUKdLJO66CrErXvQ80lVrn24XLufXO1hpRqD4QvCAAGlepg== 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 D1E422174F; Tue, 3 May 2022 16:14:52 +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 243GEqUS054348; Tue, 3 May 2022 16:14:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 243GEqvt054347; Tue, 3 May 2022 16:14:52 GMT (envelope-from git) Date: Tue, 3 May 2022 16:14:52 GMT Message-Id: <202205031614.243GEqvt054347@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: e276d2815031 - main - xhci(4): Only drop BULK and INTERRUPT endpoints to reset data toggle. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: e276d281503160ba3648bd394cde95736ee53329 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651594493; 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=a+hz7o7m2CO51nk2Us4v1PCoCu1F40DqqtGcAFU86rY=; b=dCSyBKmBWEHxNCKQBdlSO5TtyS098IlN7mj8N8fwZwVXsQYlTCJ+CPvhPDpnpYhyseaOzk OqnlSOiAE3h8W4R58j5z7elthfLz98hY5ixBimX0JT2G4R51/22HACo5bJfk5OOGOWLaXs dDGKKH23rWU7npoCdv0/P31E506OzlyusO+4W4BW2ZKCjvGmFY0vtrJhZB+Y4PDBuYKXrx 2LDKF/742WgHK26+P93QEH1xnViYU9iC9zoyaUeBe7d2PaiLaIo7tC93ijNFjajaZrIdah swVEwZ+d3SDDRFd9sGE1xhra8cJQvTCAGH0BdXmkgODVYVAvSxE2DMJfkyT/kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651594493; a=rsa-sha256; cv=none; b=xTKG6vwGBk6SsXdm1OLpwFALT8SkKJSU0dJF/R6ywxg8DgFz0/+8EP3o1d1zOaVyqF2TVu atuY4aWTuJ2GMZ5k8117mhrJy8wzg1KAEKuDe2Fq6l4aqNI2xa5pYoK6YoOnT+qJX1a9vl XtAgS2aUmIv4wvC5xVbqRbxI1OTXg5Gg33D7kRvoNF182OQUwTsXnPYjMxmCzTnBearPcP kCvRkI95zUfZ5V0W+w63mbuGsnDysv9RT/gvvZdBc9Z4IVmdHUFTIRhXWi54yD5ymj0san 97EgaP0focd1ShW3pgw3A66O08Y4CCoEBFQwIcMysSnr8MSQKgxjw++hfE9RSQ== 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=e276d281503160ba3648bd394cde95736ee53329 commit e276d281503160ba3648bd394cde95736ee53329 Author: Hans Petter Selasky AuthorDate: 2022-05-03 16:09:17 +0000 Commit: Hans Petter Selasky CommitDate: 2022-05-03 16:13:53 +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 MFC after: 3 hours Sponsored by: NVIDIA Networking --- 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 72d1ff5e0ae5..e35a0a5d2407 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -3848,9 +3848,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 "