Re: [PATCH v2] usb: hcd: Add a usb_device argument to hc_driver.endpoint_reset()

From: Mathias Nyman
Date: Thu Apr 17 2025 - 04:53:36 EST


On 15.4.2025 12.10, Michal Pecio wrote:
xHCI needs usb_device here, so it stored it in host_endpoint.hcpriv,
which proved problematic due to some unexpected call sequences from
USB core, and generally made the code more complex than it has to be.

Make USB core supply it directly and simplify xhci_endpoint_reset().
Use the xhci_check_args() helper for preventing resets of emulated
root hub endpoints and for argument validation.

Update other drivers which also define such callback to accept the
new argument and ignore it, as it seems to be of no use for them.

This fixes a 6.15-rc1 regression reported by Paul, which I was able
to reproduce, where xhci_hcd doesn't handle endpoint_reset() after
endpoint_disable() not followed by add_endpoint(). If a configured
device is reset, stalling endpoints start to get stuck permanently.

Reported-by: Paul Menzel <pmenzel@xxxxxxxxxxxxx>
Closes: https://lore.kernel.org/linux-usb/c279bd85-3069-4841-b1be-20507ac9f2d7@xxxxxxxxxxxxx/
Signed-off-by: Michal Pecio <michal.pecio@xxxxxxxxx>
---

All xhci changes look good to me

Acked-by: Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>