Re: [PATCH v2] usb: ehci: skip companion handoff when no companion exists

From: Alan Stern

Date: Mon Nov 16 2026 - 13:31:48 EST


On Mon, Nov 16, 2026 at 06:31:04AM +0000, William A. Kennington III wrote:
> EHCI controllers without an integrated root-hub transaction translator
> unconditionally set PORT_OWNER whenever a root port sees low-speed line
> state before reset, finishes reset without enabling High-Speed mode, or
> is relinquished by usbcore after enumeration fails. When no companion
> controller is present or enabled, setting PORT_OWNER routes the port
> away from EHCI to a nonexistent or disabled controller. A single missed
> High-Speed chirp or transient D+/D- bounce during reset then strands
> downstream USB 2.0 hubs until EHCI is rebound, and connecting a USB 1.1
> device leaves the port dead to later USB 2.0 devices.
>
> Check during ehci_setup() whether the root hub has an integrated
> transaction translator (ehci_is_TDI()), HCSPARAMS reports zero
> companions (HCS_N_CC == 0), both CONFIG_USB_OHCI_HCD and
> CONFIG_USB_UHCI_HCD are disabled in Kconfig (such as in
> aspeed_g4_defconfig, aspeed_g5_defconfig, and BMC builds without UHCI
> or OHCI), or a Device Tree companion phandle points to a disabled node.
> Runtime companion binding is intentionally not checked at setup time so
> modular or later-probing companion drivers still receive handoffs.
>
> When no companion is available, set ehci->no_companion so the handoff
> and companion sysfs paths check a single flag, keeping port ownership
> on EHCI when no companion exists. USB 1.1 full- and low-speed devices
> still cannot enumerate without an integrated TT or companion controller
> and will fail usbcore's normal reset retries instead of triggering a
> PORT_OWNER handoff.
>
> Signed-off-by: William A. Kennington III <william@xxxxxxxxxxxxxxx>
> ---
> Changes in v2:
> - Fold ehci_is_TDI() and its comment into ehci_has_companion() so all
> handoff and sysfs sites check ehci->no_companion alone (Michal Pecio).
> - Drop Alan Stern's v1 Acked-by due to the refactored check.
> - Link to v1: https://lore.kernel.org/linux-usb/20261114051653.1353346-1-william@xxxxxxxxxxxxxxx/

Reviewed-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>