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

Commit 2ba9b807 authored by Vijayavardhan Vennapusa's avatar Vijayavardhan Vennapusa
Browse files

dwc3: msm: Overwrite return value of pm_runtime_suspend() if > 0



Display driver calls callback to USB PD driver to release SS lanes
if it figures out to support high bandwidth transfers. Due to this,
USB PD driver sends notification to dwc3_msm driver to stop host mode
and start host mode again in high speed mode. Stop host mode already
takes care of putting mdwc device in suspend state. if mdwc device is
already suspended, pm_runtime_suspend() API returns 1 and same return
value is delegated to USB PD driver and then to display driver. This
gives false impression that SS lanes are not released, which is not
the case. Hence fix the issue by overwriting return value of
pm_runtime_suspend() API if it returns 1.

Change-Id: I6a6380a1c6fa93905711ea64e3d32d247afd1db8
Signed-off-by: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
parent f9be789a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3944,6 +3944,7 @@ static int dwc3_restart_usb_host_mode(struct notifier_block *nb,
	if (ret)
		goto err;

	dbg_event(0xFF, "USB_lpm_state", atomic_read(&dwc->in_lpm));
	/*
	 * stop host mode functionality performs autosuspend with mdwc
	 * device, and it may take sometime to call PM runtime suspend.
@@ -3951,6 +3952,12 @@ static int dwc3_restart_usb_host_mode(struct notifier_block *nb,
	 * suspend immediately to put USB controller and PHYs into suspend.
	 */
	ret = pm_runtime_suspend(mdwc->dev);
	/*
	 * If mdwc device is already suspended, pm_runtime_suspend() API
	 * returns 1, which is not error. Overwrite with zero if it is.
	 */
	if (ret > 0)
		ret = 0;
	dbg_event(0xFF, "pm_runtime_sus", ret);

	dwc->maximum_speed = usb_speed;