Skip to content

Commit fa27e2f

Browse files
Thinh Nguyenfelipebalbi
authored andcommitted
usb: dwc3: ep0: Fix delay status handling
If we want to send a control status on our own time (through delayed_status), make sure to handle a case where we may queue the delayed status before the host requesting for it (when XferNotReady is generated). Otherwise, the driver won't send anything because it's not EP0_STATUS_PHASE yet. To resolve this, regardless whether dwc->ep0state is EP0_STATUS_PHASE, make sure to clear the dwc->delayed_status flag if dwc3_ep0_send_delayed_status() is called. The control status can be sent when the host requests it later. Cc: <stable@vger.kernel.org> Fixes: d97c78a ("usb: dwc3: gadget: END_TRANSFER before CLEAR_STALL command") Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
1 parent 48e7bbb commit fa27e2f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/usb/dwc3/ep0.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,10 +1058,11 @@ void dwc3_ep0_send_delayed_status(struct dwc3 *dwc)
10581058
{
10591059
unsigned int direction = !dwc->ep0_expect_in;
10601060

1061+
dwc->delayed_status = false;
1062+
10611063
if (dwc->ep0state != EP0_STATUS_PHASE)
10621064
return;
10631065

1064-
dwc->delayed_status = false;
10651066
__dwc3_ep0_do_control_status(dwc, dwc->eps[direction]);
10661067
}
10671068

0 commit comments

Comments
 (0)