From nobody Tue Jun 23 20:57:09 2026 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 4glHSW39cfz6j6Vn for ; Tue, 23 Jun 2026 20:57:15 +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 4glHSW0HpXz3K77 for ; Tue, 23 Jun 2026 20:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782248235; 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=IG6dGGtnBRz3gg2jY/P+cf+FkTjulv4h3X9/Rf5JLldMk/9rEc2u7mNExnGVQuku1RruWI tkWdkBXKSONh+CCzwhV7pzhGJsE8wNiJU6QHTqHgpBim/PrD/yPnfWruCTQhPZba4CNFBN FCwZkD8BN3fiFW8882g+D1HdDVzyNkwQ2XmKz47g/W6KOHiKH1BjSKMPL3r0RB25uFxlxQ yRMPy6Kpkdthtof1kQfdFXU5QxZh+UA2ekrtru4VqUfw9RoPd9frqyFUyoGSEGD3nP/HgM LUt0nIHonirBnDUw75yq+Bry+bf8zuGBGzWaZWOLirK7Je0ktMrbT61yKpxZFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782248235; a=rsa-sha256; cv=none; b=aiPODkdK67J48762nrFPvxTsqnfNRf8Rq1HY4Wz9SIh/+ntCmZZe6uRdr/nWiuI0jR0F5x J4YVX7NBWyH69BcYf5O2U2/7sRMx9fGivucBtSG6l8q1DH8TwwhtdEQof5BTN0MMgFY8Mo 4itSpo+sXAGXXrQNvd4p5VfNSj6UilzxkPuCqF8Q0z2k+640Kgrg0VXlc1IuVHu9d21uI9 qj35rFDcqGXpAoRsWLlAaF7eA2hKD4dX37DjwtGAuJ7FElMXs+E6e1TVT506XEp+DP1Lyg snWXvqaETOcv2zwSRYt3WO+ou2PgjqgpGtPjVLkwn1+ehgJsaWgaRzkI8XbeKQ== 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=1782248235; 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=pw0RueDjj5jSPZeeRZ0AKDqLpcI4ak8cR5V1NHJ++OpG6Diu4yUiBYOq/gaIbps2w/F8hu 9OSDLu3kneWJWtwaJzlS6dMoI95bSRzst0VQgZ8fYoYEJIsWrkCD7UNwGrwFrpD8tmnvSo M9IJGt/cXQj0oxF0wGSxonf9C3WOJh+0+5P6p15Up6KMhhKsxbSk240ipJJVb8cz9Ix3G5 NmKUdIgldFXJfG2HTo8qLXm0uSNXDzJpn0L+5A/r29JrcGNjItl8tRfZSXQ3t7PE2WUTXD htEYTC+bkD06bJiLD6FjeN0lJy5KILCPu8q8Hzp6dc24kOugF8NQ8DZiNfghyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4glHSV46rWzqHQ for ; Tue, 23 Jun 2026 20:57:14 +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: 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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; }