usb: dwc3: gadget: Clear delayed_status on reset

If the host issued BUS RESET just after the SETUP packet
for which the composite device has sent the DELAYED_STATUS,
the device does not respond on the next SETUP which is
generally GET_DEVICE_DESCRIPTOR.
Fix this by clearing the delayed_status on BUS RESET to
ensure the response from composite device for
GET_DEVICE_DESCRIPTOR can be queued properly on endpoint 0.

Change-Id: I5e93b5e3c61eb943443a4ef9ec554de2935dfb4e
Signed-off-by: Sriharsha Allenki <sallenki@codeaurora.org>
tirimbino
Sriharsha Allenki 5 years ago committed by Gerrit - the friendly Code Review server
parent 0645bbde34
commit 5b06d2cdc7
  1. 5
      drivers/usb/dwc3/gadget.c

@ -847,7 +847,7 @@ static void dwc3_remove_requests(struct dwc3 *dwc, struct dwc3_ep *dep)
if (dep->number == 1 && dwc->ep0state != EP0_SETUP_PHASE) {
unsigned int dir;
dbg_log_string("CTRLPEND", dwc->ep0state);
dbg_log_string("CTRLPEND(%d)", dwc->ep0state);
dir = !!dwc->ep0_expect_in;
if (dwc->ep0state == EP0_DATA_PHASE)
dwc3_ep0_end_control_data(dwc, dwc->eps[dir]);
@ -3328,7 +3328,7 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc)
if (dwc->ep0state != EP0_SETUP_PHASE) {
unsigned int dir;
dbg_event(0xFF, "CONTRPEND", dwc->ep0state);
dbg_event(0xFF, "CONTRPEND(%d)", dwc->ep0state);
dir = !!dwc->ep0_expect_in;
if (dwc->ep0state == EP0_DATA_PHASE)
dwc3_ep0_end_control_data(dwc, dwc->eps[dir]);
@ -3337,6 +3337,7 @@ static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc)
dwc3_ep0_stall_and_restart(dwc);
}
dwc->delayed_status = false;
dwc3_stop_active_transfers(dwc);
dwc3_clear_stall_all_ep(dwc);

Loading…
Cancel
Save