From nobody Tue Jun 23 20:57:09 2026 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 4glHSQ0FxSz6j6gF for ; Tue, 23 Jun 2026 20:57:10 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4glHSP4GDnz3Jtl for ; Tue, 23 Jun 2026 20:57:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782248229; 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=i2m7B4mrmJAX2/WFYDEZ2jmqYcE9z9+YJsljONUtLF8=; b=WvY/bcwkyAoisEPvudzVuIz6vXoc5Udw7nPZFHbQzVlNpbNEeQwhdSGBhKpBaNa744vvqB epAIzk8hrZvtRNztx9fMg9c4o60zo3g59L71cTaUkShlSMf9zdIZVsoKj4kaiBdfjdNEhe BayLqhWOY5ERK517Lu/AnIYNQwBuHdTGTtW1luNxn9kMv/T7G5QXSQpG+4AInP1V9JR+4x o6mwz7G8undZ425UUkcUO+Qw9beY2Lr0tUOMEKnP/D99fHyEO0YD3UhegmxBI3px4bbux8 5mE523ATOh9wDBXtTtoZ6YaTSPMOUK6BCQCvnuycuI/KZG6PzdrsTWGecBMycw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782248229; a=rsa-sha256; cv=none; b=RgKxP2BIJBQEFwWG38ULyT5Vk9IJlT0qjirpcbnvKRecPkp55FFLKzKkIjb1NVyzfJWFBz guSEWRl21vstKbiRe+IOJlDjmBSr/JracNXT+jpIVK49sIpwA0j5NYN6krGk//ZpyFEchK bDcoVf2LwILRmbgCfgBHgKp+E7RnKsfnqwG1pAUPuVDACk4hUe+hVVZE9zB4k9Y6N8eHdZ +kf/8Z2597EmBWwx3af6m8MuA2JBqLyQGGP4HdtOSC2F5ap9JWrXUbCI+icGSMp7zp/d6+ up1atcP2YcVmTdg3zDl6mTnQoF4/MhMJEl3ffX2Iki5YiDdFfJjgB6RQAAWsXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782248229; 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=i2m7B4mrmJAX2/WFYDEZ2jmqYcE9z9+YJsljONUtLF8=; b=BfgsoZem3Nrawhpru+9Ba/YomeLPKrrKuwjaTsN0mhj4VG8O/G6crSpDDGr+9E9rgz0LYS r6J6dJ2G/66HpI6gneI0pyOPZyp5uipdvgjtBTyzFPsGJW8rqwL8RFGOqB0yYEkSEazLBz YhKY/hjBqDn+RpPs0YzjpCsqwXBUMd4vqUjuHQ4QSu096RMn8hZfTtwk4mHP9Dn+khu+4r kbGeqJU5lVlQYYBbiOTVc0TZi78OwwvriON5stVE0uSGwCMILP1oM4c590qcVLhJJTYLFU wdUFL7h41T957iacJnLmbk4Cf+qChIHmJNV7bqKSM+pEGIeUvehh9+pJj7F5Fg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4glHSP3BjBzqTJ for ; Tue, 23 Jun 2026 20:57:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 182ed by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 23 Jun 2026 20:57:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: ShengYi Hung Subject: git: 2cf3e6b554b7 - stable/14 - xhci: Do not drop and add bits in xhci 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: aokblast X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2cf3e6b554b7e0da480880c114d2fa539d2f7570 Auto-Submitted: auto-generated Date: Tue, 23 Jun 2026 20:57:09 +0000 Message-Id: <6a3af325.182ed.19838b06@gitrepo.freebsd.org> The branch stable/14 has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=2cf3e6b554b7e0da480880c114d2fa539d2f7570 commit 2cf3e6b554b7e0da480880c114d2fa539d2f7570 Author: ShengYi Hung AuthorDate: 2026-05-21 12:49:42 +0000 Commit: ShengYi Hung CommitDate: 2026-06-23 20:56:03 +0000 xhci: Do not drop and add bits in xhci Drop and Add bits reset the data toggle for high-speed devices in XHCI. The toggle bit represents the sequence number in USB 2.0 transfers. However, a device can only recognize that the toggle bit has been reset while in the HALT state. As a result, the host and device toggle values may become mismatched, causing xHCI to reject the packet. This issue was observed while testing the EZ-USB FX2 device. The transfer may then return to the original value after a bi-directional TD because the toggle field is only one bit wide. This explains the reson that we can only receive packets bi-transfer in some case. Therefore, we do not reset the toggle bit here. Reviewed by: adrian MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57146 (cherry picked from commit 28d85db46b484589e2ee74cf4b270db066821de1) --- sys/dev/usb/controller/xhci.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 17800dc11d0c..c9820ce55423 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -3813,10 +3813,8 @@ xhci_configure_reset_endpoint(struct usb_xfer *xfer) */ switch (xhci_get_endpoint_state(udev, epno)) { case XHCI_EPCTX_0_EPSTATE_DISABLED: - drop = 0; - break; case XHCI_EPCTX_0_EPSTATE_STOPPED: - drop = 1; + drop = 0; break; case XHCI_EPCTX_0_EPSTATE_HALTED: err = xhci_cmd_reset_ep(sc, 0, epno, index); @@ -3825,9 +3823,15 @@ xhci_configure_reset_endpoint(struct usb_xfer *xfer) DPRINTF("Could not reset endpoint %u\n", epno); break; default: - drop = 1; + /* + * xHCI spec 4.6.8: + * The Drop and Add operation resets the toggle bit, which can + * cause a toggle mismatch between the device and host. As a + * result, xHCI may refuse to receive or process the packet. + */ err = xhci_cmd_stop_ep(sc, 0, epno, index); - if (err != 0) + drop = (err != 0); + if (drop) DPRINTF("Could not stop endpoint %u\n", epno); break; }