Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 May 2022 12:27:32 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 340ed8ccb576 - releng/13.1 - xhci(4): Only drop BULK and INTERRUPT endpoints to reset data toggle.
Message-ID:  <202205041227.244CRWtO088973@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch releng/13.1 has been updated by hselasky:

URL: https://cgit.FreeBSD.org/src/commit/?id=340ed8ccb576e74e0cc8e5f1e8e3bbabbe53f090

commit 340ed8ccb576e74e0cc8e5f1e8e3bbabbe53f090
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-05-03 16:09:17 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-05-04 07:20:46 +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)
    (cherry picked from commit 610528736f3f0bf51f990dd93c5061a7a437e519)
---
 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 "



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202205041227.244CRWtO088973>