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

Commit 90809f41 authored by Wesley Cheng's avatar Wesley Cheng Committed by Vijayavardhan Vennapusa
Browse files

USB: ehci-msm2: Fix USB lpm issue after failure to suspend PHY



Whenever suspend routine is called and if fails to suspend
PHY, will return -ETIMEDOUT to PM core. Due to this, PM core
will set runtime error flag for the device. This leads to
subsequent suspend routines are not being called and USB does
not enter low power mode. Hence disable runtime PM and reenable
it after recovery mechanism of removing and adding hcd.

Change-Id: I44cc4c7c624887dfc1ecd23bd57f460479cb3f26
Signed-off-by: default avatarWesley Cheng <wcheng@codeaurora.org>
Signed-off-by: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
parent c936945a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -690,11 +690,16 @@ static void msm_ehci_phy_susp_fail_work(struct work_struct *w)
					phy_susp_fail_work);
	struct usb_hcd *hcd = mhcd_to_hcd(mhcd);

	pm_runtime_disable(mhcd->dev);

	msm_ehci_vbus_power(mhcd, 0);
	usb_remove_hcd(hcd);
	msm_hsusb_reset(mhcd);
	usb_add_hcd(hcd, hcd->irq, IRQF_SHARED);
	msm_ehci_vbus_power(mhcd, 1);

	pm_runtime_set_active(mhcd->dev);
	pm_runtime_enable(mhcd->dev);
}

#define PHY_SUSP_TIMEOUT_MSEC	500