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

Commit 70516292 authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: dwc3: gadget: Update dwc->link_state on connect interrupt



Currently dwc3->link_state is being updated from reset, disconnect,
wakeup and suspend interrupt context. It is being seen that on reset,
link state is still DWC3_LINK_STATE_U3 which causing some of function
driver's control/interrupt transfer to fail as it tries to perform
remote wakeup functionality and keep retrying it. With that host is
trying to re-enumerate device. Fix this issue by updating link state
on receiving connect interrupt where host is already successfully
perform speed detection and device side usb is moved into operational
DWC3_LINK_STATE_U0 state.

Change-Id: I3052eb8bd4e629587ad967d7243b87e7cdb2587b
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 069f11cb
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2990,6 +2990,8 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc)
	dwc->speed = speed;

	dwc3_update_ram_clk_sel(dwc, speed);
	dwc->link_state = dwc3_get_link_state(dwc);
	pr_debug("%s(): LINK_STATE:%d\n", __func__, dwc->link_state);

	switch (speed) {
	case DWC3_DCFG_SUPERSPEED: