Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b06d2cd authored by Sriharsha Allenki's avatar Sriharsha Allenki Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarSriharsha Allenki <sallenki@codeaurora.org>
parent 0645bbde
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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);