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

Commit 8a5cba8b authored by Mayank Rana's avatar Mayank Rana
Browse files

dwc3-msm: Flush sm_work with dwc3_restart_usb_host_mode() API



There is race seen between USB stop host mode and USB start host
mode when Linux DP driver calls usbpd_release_ss_lane() API for
4 lane DP functionality. This results into trying to delete xhci
platform device before it has been added causing multiple crashes.
Fix this issue by flushing sm_work before trying to stop host mode
functionality.

Change-Id: Ifbc888ecd87836d29c93b0c402613743b19982ea
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 8e96f4f7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3897,6 +3897,8 @@ static int dwc3_restart_usb_host_mode(struct notifier_block *nb,
	if (dwc->maximum_speed == usb_speed)
		goto err;

	dbg_event(0xFF, "fw_restarthost", 0);
	flush_delayed_work(&mdwc->sm_work);
	dbg_event(0xFF, "stop_host_mode", dwc->maximum_speed);
	ret = dwc3_otg_start_host(mdwc, 0);
	if (ret)