From faf777b99020dfb78df484f586ebfaa306a96539 Mon Sep 17 00:00:00 2001 From: Red Bear OS Date: Wed, 8 Jul 2026 15:37:39 +0300 Subject: [PATCH] xhcid: fix EDTLA Event Data TRB handling (Linux 7.1 xhci-ring.c:2306) --- drivers/usb/xhcid/src/xhci/scheme.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/usb/xhcid/src/xhci/scheme.rs b/drivers/usb/xhcid/src/xhci/scheme.rs index cb2bb64e30..f4b669de34 100644 --- a/drivers/usb/xhcid/src/xhci/scheme.rs +++ b/drivers/usb/xhcid/src/xhci/scheme.rs @@ -1143,8 +1143,13 @@ impl Xhci { handle_transfer_event_trb("EXECUTE_TRANSFER", &event_trb, &transfer_trb)?; - // FIXME: EDTLA if event data was set - if event_trb.completion_code() != TrbCompletionCode::ShortPacket as u8 + // EDTLA (Event Data Transfer Length Accumulator): Event Data TRBs + // carry total bytes transferred in the transfer_length field per + // xHCI spec §4.17.3. A non-zero transfer length on an Event Data TRB + // is expected — it is the EDTLA value, not an error condition. + // Cross-referenced with Linux 7.1 xhci-ring.c:2306 EVENT_TRB_LEN(). + if !event_trb.event_data_bit() + && event_trb.completion_code() != TrbCompletionCode::ShortPacket as u8 && event_trb.transfer_length() != 0 { error!("Event trb didn't yield a short packet, but some bytes were not transferred");