Skip to content

Commit 2e61dd3

Browse files
Kuen-Han Tsaigregkh
authored andcommitted
usb: dwc3: Ignore late xferNotReady event to prevent halt timeout
commit 5857711 upstream. During a device-initiated disconnect, the End Transfer command resets the event filter, allowing a new xferNotReady event to be generated before the controller is fully halted. Processing this late event incorrectly triggers a Start Transfer, which prevents the controller from halting and results in a DSTS.DEVCTLHLT bit polling timeout. Ignore the late xferNotReady event if the controller is already in a disconnected state. Fixes: 72246da ("usb: Introduce DesignWare USB3 DRD Driver") Cc: stable <stable@kernel.org> Signed-off-by: Kuen-Han Tsai <khtsai@google.com> Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Link: https://lore.kernel.org/r/20250807090700.2397190-1-khtsai@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 36b93b3 commit 2e61dd3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/usb/dwc3/gadget.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3779,6 +3779,15 @@ static void dwc3_gadget_endpoint_transfer_complete(struct dwc3_ep *dep,
37793779
static void dwc3_gadget_endpoint_transfer_not_ready(struct dwc3_ep *dep,
37803780
const struct dwc3_event_depevt *event)
37813781
{
3782+
/*
3783+
* During a device-initiated disconnect, a late xferNotReady event can
3784+
* be generated after the End Transfer command resets the event filter,
3785+
* but before the controller is halted. Ignore it to prevent a new
3786+
* transfer from starting.
3787+
*/
3788+
if (!dep->dwc->connected)
3789+
return;
3790+
37823791
dwc3_gadget_endpoint_frame_from_event(dep, event);
37833792

37843793
/*

0 commit comments

Comments
 (0)