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

Commit 92f298e4 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "USB: Fix bug in ext_chg_active flag handling"

parents edab659c b2120c9d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2564,12 +2564,15 @@ static void msm_otg_wait_for_ext_chg_done(struct msm_otg *motg)

	if (motg->ext_chg_active) {

do_wait:
		pr_debug("before msm_otg ext chg wait\n");

		t = wait_for_completion_timeout(&motg->ext_chg_wait,
				msecs_to_jiffies(3000));
		if (!t)
			pr_err("msm_otg ext chg wait timeout\n");
		else if (motg->ext_chg_active)
			goto do_wait;
		else
			pr_debug("msm_otg ext chg wait done\n");
	}
@@ -4114,6 +4117,7 @@ msm_otg_ext_chg_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
		pr_debug("%s: LPM block request %d\n", __func__, val);
		if (val) { /* block LPM */
			if (motg->chg_type == USB_DCP_CHARGER) {
				motg->ext_chg_active = true;
				/*
				 * If device is already suspended, resume it.
				 * The PM usage counter is incremented in