]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: Flush altsetting 0 endpoints before reinitializating them after reset.
authorMathias Nyman <mathias.nyman@linux.intel.com>
Wed, 14 May 2025 13:25:20 +0000 (16:25 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:05:22 +0000 (11:05 +0100)
commit8bc30532b9784c6bd1a39361a30f664d745da3d1
tree8dc3a6c19b48d3343ffc09bb6c2477dd2045e546
parentf78b3fdd2c7f7d9a3d34f9146bb90b152f044f61
usb: Flush altsetting 0 endpoints before reinitializating them after reset.

commit 89bb3dc13ac29a563f4e4c555e422882f64742bd upstream.

usb core avoids sending a Set-Interface altsetting 0 request after device
reset, and instead relies on calling usb_disable_interface() and
usb_enable_interface() to flush and reset host-side of those endpoints.

xHCI hosts allocate and set up endpoint ring buffers and host_ep->hcpriv
during usb_hcd_alloc_bandwidth() callback, which in this case is called
before flushing the endpoint in usb_disable_interface().

Call usb_disable_interface() before usb_hcd_alloc_bandwidth() to ensure
URBs are flushed before new ring buffers for the endpoints are allocated.

Otherwise host driver will attempt to find and remove old stale URBs
from a freshly allocated new ringbuffer.

Cc: stable <stable@kernel.org>
Fixes: 4fe0387afa89 ("USB: don't send Set-Interface after reset")
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20250514132520.225345-1-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hub.c