From a83be41585b1a03a82ebf97f188c07b8c3034fb4 Mon Sep 17 00:00:00 2001 From: vasilito Date: Mon, 20 Jul 2026 19:22:18 +0900 Subject: [PATCH] =?UTF-8?q?usb:=20bump=20base=20fork=20=E2=80=94=20P7-A=20?= =?UTF-8?q?USB=202.0=20HW=20LPM=20implemented=20in=20xhcid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit base -> 2a3b0d4e: per-device USB 2.0 hardware LPM (L1) enablement at attach in xhcid (full Linux xhci.c:4650 gate chain, BESL/HIRD params, MEL Evaluate Context, PORTHLPMC/PORTPMSC sequence). Plan P7-A updated: xhcid side done; ehcid USBCMD.HIRD and hardware L1 validation remain. --- local/docs/USB-IMPLEMENTATION-PLAN.md | 14 +++++++++++++- local/sources/base | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/local/docs/USB-IMPLEMENTATION-PLAN.md b/local/docs/USB-IMPLEMENTATION-PLAN.md index 12d372cff3..0208dcfb9d 100644 --- a/local/docs/USB-IMPLEMENTATION-PLAN.md +++ b/local/docs/USB-IMPLEMENTATION-PLAN.md @@ -659,6 +659,17 @@ A `redbear-usbtest` tool that exercises: **Reference:** `linux-7.1/drivers/usb/host/xhci-port.h:135-173`, `xhci-hub.c`. +**Status (2026-07-20):** xhcid per-device enablement **implemented** (base fork +`2a3b0d4e`): full Linux xhci.c:4650 gate chain at attach +(`hw_lpm_support` && per-port HLC && device `USB_LPM_SUPPORT` in BOS && +non-hub && root-hub-direct), BESL vs HIRD parameter selection +(`calculate_hird_besl`, Linux xhci.c:4594), MEL Evaluate Context +(`change_max_exit_latency`, Linux xhci.c:4520), and the PORTHLPMC/PORTPMSC +programming sequence. LPM enable failure logs and continues (device works +in U0). Compile-verified; 3 BOS accessor unit tests. **Runtime validation +requires LPM-capable hardware** — QEMU's xHCI does not advertise HLC, so +the L1-entry exit criterion remains hardware-validation debt (P8-A). + **Status (2026-07-18):** Substrate done in P2-B — HLC/BLC/L1C parsed from the Supported Protocol capability (NOT `HCCPARAMS1`: an earlier plan version and driver accessor were wrong; HLC lives in the protocol caps port_info DWORD per @@ -670,8 +681,9 @@ defensive LPM clear runs on USB2 ports at attach when unsupported. 1. ~~Parse HLC~~ ✅ done (P2-B, protocol caps). 2. Implement `usb_set_device_initiated_lpm()` (port hardware LPM control via PORTSC.PORT_L1DEV). -3. xhcid: per-device `PORT_HLE` enablement at attach — gate chain per Linux xhci.c:4650: `!HW_LPM_DISABLE && hw_lpm_support && udev->lpm_capable && root-hub-direct && non-hub`, then BESL params + MEL Evaluate Context + `enable_lpm()`. +3. ~~xhcid: per-device `PORT_HLE` enablement at attach~~ ✅ done (2026-07-20, `2a3b0d4e`). 4. ehcid: implement via USBCMD.HIRD (Host Initiated Resume Duration). +5. Runtime L1-entry validation on LPM-capable hardware (P8-A hardware matrix). **Exit:** USB 2.0 devices on HWA LPM-capable hubs enter L1 state when idle. diff --git a/local/sources/base b/local/sources/base index 28afc1fefd..2a3b0d4e0a 160000 --- a/local/sources/base +++ b/local/sources/base @@ -1 +1 @@ -Subproject commit 28afc1fefdd1cd90dc117be735c7103b1fa1e56d +Subproject commit 2a3b0d4e0a0333bde577e780044f4e4187ce1a38