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

Commit f6842fc3 authored by Vijayavardhan Vennapusa's avatar Vijayavardhan Vennapusa
Browse files

USB: phy-msm-usb: Fix bug in handling cable connect event during bootup



Currently USB driver waits for 5 sec timeout for PMIC driver
notifying initial cable connect status for first time otg_sm_work
is scheduled. If timeout happens, USB will enter low power mode.
If PMIC driver notifies initial cable status after timeout, USB
driver doesn't schedule sm_work to handle it. This results in USB
detection failure when target is booted with cable connected. Fix
this by scheduling sm_work in this case by having proper check.

CRs-Fixed: 688006
Change-Id: Ibef2e709c5b6b01c4e5b10daf36e7f0451372e9a
Signed-off-by: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
parent a22d6f65
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3410,11 +3410,17 @@ static void msm_otg_set_vbus_state(int online)

	if (!init) {
		init = true;
		if (pmic_vbus_init.done &&
				test_bit(B_SESS_VLD, &motg->inputs)) {
			pr_debug("PMIC: BSV came late\n");
			goto out;
		}
		complete(&pmic_vbus_init);
		pr_debug("PMIC: BSV init complete\n");
		return;
	}

out:
	if (test_bit(MHL, &motg->inputs) ||
			mhl_det_in_progress) {
		pr_debug("PMIC: BSV interrupt ignored in MHL\n");