From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796003060; b=rQVy0kImSIQgMsQnJPu09fwLUX0UNatfNBIw5Xu+4wwLbawcaP8joU9/h9ktfTI7RROu JRlfMHv+yPaTH1FG4a/T19u7i71zDmg5N5DGqUoni7lujFsD3Tj3feH3bO9dP1JkOuRu5 T9odlXByfN77VZ4BPDl4K1YsvuJJHo+KEOqaAq3bK+SmvcFpjZvDk6H3h8NjTPJd9MDnl UWGRChbqxKBIVqZSZHYNhr6WrX67xIVuNLGtU+BWcrf7Qi/5lvOjkVPQUDSQyNkINaSUf FUbalEFOuGCXQm8igFPadfZYwfmdJHKhXkuC+GKur4C1O3ifcX+XgUfXGHMQ+k/glQg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796003060; h=Received:DKIM-Signature:Received:From:To:Subject:Date: X-Bugzilla-Reason:X-Bugzilla-Type:X-Bugzilla-Watch-Reason: X-Bugzilla-Product:X-Bugzilla-Component:X-Bugzilla-Version: X-Bugzilla-Keywords:X-Bugzilla-Severity:X-Bugzilla-Who: X-Bugzilla-Status:X-Bugzilla-Resolution:X-Bugzilla-Priority: X-Bugzilla-Assigned-To:X-Bugzilla-Flags:X-Bugzilla-Changed-Fields: Message-ID:Content-Type:Content-Transfer-Encoding:X-Bugzilla-URL: Auto-Submitted:MIME-Version; bh=sWsVLtSmb9otL+dBY2j/lbfmRBzI3s5M4aWqWjv5FuY=; b=p1M6lzB0O4CtyZhKeJWqmbmqDJNoFkkD+GPoTKFS4vBAXZCPHioFQ5LO0IQVpjw+3ARg WcOse/IYuRJsG03gR3pP4sbdYX2WidRN8vU5pukfgzmyf9hPTbJikDyFXd4eALtBeztWt vwed8ztDuP9H3Pq+6jB5tR75AbVHsBVKcLzWloojLsFmVvs9DxLk/bAbIEsKArAH77rK6 FUGOv+HpfJHCbWH3n6H3lRIoiHY6zktk2JWXqpczjX0T5n1kYagZ9s1BnpMKXMi0E2LNa Q6kf2ZQAfHZtrdNeTyHKCSjgDZ0kKBV+GV3wOjHIMXJ53DU8Uwdq+mF2uyVlJOuN/IA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=YIpP1Bgx; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1FF2606A31C for ; Mon, 30 Nov 2026 01:44:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=YIpP1Bgx Received: by smtp.kernel.org (Postfix) with ESMTPS id 79F2F1F00897 for ; Mon, 30 Nov 2026 01:44:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796003059; bh=sWsVLtSmb9otL+dBY2j/lbfmRBzI3s5M4aWqWjv5FuY=; h=From:To:Subject:Date; b=YIpP1Bgx9EMNi0ROkJmWQoHCaOEHtMo/6RHR+98/nC42VB0ob9qbQ32J2CI5voZNX 945c/BLqq16RSrM4ZMks5fGRPG9NmMFXRQbQi41u0lQO0Z4oa75MCiE70ll5TqPbM6 fRyyzohJ0kT/fL1TPjoA3j5HzTGWoQtPMV55Zic0r1VzKS3qkBz7TZ3BythQFO7a+7 KCOaAUFitQf/gsPA12uuUExZu18cUNOXWPrnlV4lv/WQE91lMaBPiOC5sQ6BZ6lKus fxTui5/fVSkErP+iV53vLnKR9uY2b7NBU0FrvrPhKeyFTi/ML8bLn1DEUAZD+CD6EJ g+VDfmCAs/w9g== Received: by aws-us-west-2-korg-bugzilla-alma10-1.codeaurora.org (Postfix, from userid 48) id 779CA240040C; Mon, 30 Nov 2026 01:44:19 +0000 (UTC) From: bugzilla-daemon@kernel.org To: linux-usb@vger.kernel.org Subject: [Bug 222348] New: xhci: dbc: permanent "failed to queue trbs" wedge after 254 TRBs (commit 7ee645963075 never advances dep->ring->dequeue) Date: Mon, 30 Nov 2026 01:44:19 +0000 X-Bugzilla-Reason: None X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: AssignedTo drivers_usb@kernel-bugs.kernel.org X-Bugzilla-Product: Drivers X-Bugzilla-Component: USB X-Bugzilla-Version: 2.5 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mcboyle1865@gmail.com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: drivers_usb@kernel-bugs.kernel.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cf_regression Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugzilla.kernel.org/ Auto-Submitted: auto-generated X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 https://bugzilla.kernel.org/show_bug.cgi?id=3D222348 Bug ID: 222348 Summary: xhci: dbc: permanent "failed to queue trbs" wedge after 254 TRBs (commit 7ee645963075 never advances dep->ring->dequeue) Product: Drivers Version: 2.5 Hardware: Intel OS: Linux Status: NEW Severity: normal Priority: P3 Component: USB Assignee: drivers_usb@kernel-bugs.kernel.org Reporter: mcboyle1865@gmail.com Regression: No After commit 7ee645963075 ("usb: xhci: remove legacy 'num_trbs_free' tracki= ng", merged for v7.2-rc1 and backported to Ubuntu 26.04 7.0.0-44-generic), xHCI Debug Capability (`xhci_dbc`, `/dev/ttyDBC0`) deterministically wedges after exactly 254 bulk transfers (254 * 1024 B =3D 260,096 B). On transfer #255, `xhci_dbc_queue_bulk_tx()` permanently returns `-EBUSY`, `dbc_ep_do_queue()` logs `failed to queue trbs`, and TX stalls permanently at 0 B/s until cable disconnect or USB reset. This regression is still present on `torvalds/linux` master (`v7.4-rc5`). ### Hardware & Kernel - Controller: Intel 800-Series (Arrow Lake) PCH xHCI (`0000:80:14.0`), SuperSpeedPlus 10000M USB-C host-to-host cable - Kernel tested: Ubuntu 26.04 `7.0.0-44-generic` (`CONFIG_USB_XHCI_HCD=3Dy`, `CONFIG_USB_XHCI_DBGCAP=3Dy`) - Upstream verified: `torvalds/linux` `v7.4-rc5` (`drivers/usb/host/xhci-dbgcap.c`) ### Root Cause Commit `7ee645963075651d72f8d85bee428a9b7f1f148c` removed `ring->num_trbs_f= ree` and changed `xhci_dbc_queue_bulk_tx()` (`drivers/usb/host/xhci-dbgcap.c:298= `) to: if (xhci_num_trbs_free(ring) <=3D num_trbs) return -EBUSY; `xhci_num_trbs_free(ring)` (`drivers/usb/host/xhci-ring.c:351`) computes fr= ee TRBs dynamically from `ring->enqueue` to `ring->dequeue`. However, `drivers/usb/host/xhci-dbgcap.c` NEVER advances `dep->ring->dequeu= e` for `BULK_IN` / `BULK_OUT` transfer rings (`inc_evt_deq()` is only called on `dbc->ring_evt`). As a result: 1. `dep->ring->dequeue` stays permanently pinned at `&deq_seg->trbs[0]`. 2. On a 1-segment DbC transfer ring (`TRBS_PER_SEGMENT =3D 256`, Link TRB at index 255): - Transfers 1..254 advance `ring->enqueue` from `trbs[0]` to `trbs[254]`. - After transfer #254, `xhci_num_trbs_free(ring)` returns `255 - 254 =3D= 1`. - On transfer #255 (`num_trbs =3D 1`), `xhci_num_trbs_free(ring) <=3D 1` evaluates true (`1 <=3D 1`) and returns `-EBUSY`. 3. `dbc_ep_do_queue()` (`drivers/usb/host/xhci-dbgcap.c:361`) logs `failed = to queue trbs` and returns `-EFAULT` permanently. ### Deterministic Reproducer Connect two Linux hosts via a passive USB-C 3.2 Gen 2 cable (`1d6b:0010` / `usb_debug` on Host, `echo enable > /sys/bus/pci/devices/0000:80:14.0/dbc` = on Target): 1. On Target (`/dev/ttyDBC0`) and Host (`/dev/ttyUSB0`), configure both TTY= s in raw mode (`stty -F raw -echo`). 2. Stream >260 KiB in either direction (even paced slowly at 300 x 1024 B writes with a 2 ms delay between writes, ~4 Mbps): - Target -> Host: delivers exactly 260,096 bytes (254 x 1024 B) at ~213 Mbps, then hangs permanently. - Host -> Target: delivers exactly 260,096 bytes (254 x 1024 B) at ~130 Mbps, then hangs permanently. - Paced 300 x 1024 B (2 ms gap): still wedges at exactly 260,096 bytes (254.0 KiB), proving a deterministic TRB-count leak rather than congestion. 3. Target `dmesg` immediately logs: `xhci_hcd 0000:80:14.0: failed to queue trbs` ### Proposed Fix In `drivers/usb/host/xhci-dbgcap.c`, advance `dep->ring->dequeue` in `dbc_handle_xfer_event()` whenever a request is retired (in both the stale/stalled giveback loop and normal `xhci_dbc_giveback()`), wrapping over the Link TRB at `TRBS_PER_SEGMENT - 1` (e.g., via `inc_deq()` or a small `dbc_inc_deq(ring)` helper): /* Inside dbc_handle_xfer_event(), when retiring each req on dep->ring:= */ ring->dequeue =3D req->trb + 1; if (trb_is_link(ring->dequeue)) { ring->deq_seg =3D ring->deq_seg->next; ring->dequeue =3D ring->deq_seg->trbs; } (Or alternatively call `inc_deq(xhci, dep->ring)` / revert `7ee645963075` on stable branches.) --=20 You are receiving this mail because: You are watching the assignee of the bug.=