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

Commit f240f4c9 authored by Sujeet Kumar's avatar Sujeet Kumar Committed by Manu Gautam
Browse files

USB: phy: Disable phy_irq before processing LPM sequence



phy_irq may arrive any time when the micro-A cable is connected.
If the USB low power mode sequence is ongoing, it would turn off
the usb core clock before setting the in_lpm flag. Because in_lpm
flag is not set, async irq would not resume USB. In such race
condition, there is a chance to hit into unclocked access noc
error.
Disable the phy_irq before beginning of the LPM sequence and enable
is back again at the end of LPM after setting in_lpm flag.

Change-Id: Ia5e7291502be05be88bbe4ae4c5d0920c9665ca2
Signed-off-by: default avatarSujeet Kumar <ksujeet@codeaurora.org>
parent d3846f3c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1171,6 +1171,8 @@ static int msm_otg_suspend(struct msm_otg *motg)

	motg->ui_enabled = 0;
	disable_irq(motg->irq);
	if (motg->phy_irq)
		disable_irq(motg->phy_irq);
lpm_start:
	host_bus_suspend = !test_bit(MHL, &motg->inputs) && phy->otg->host &&
		!test_bit(ID, &motg->inputs);
@@ -1210,6 +1212,8 @@ lpm_start:
				motg->inputs, motg->chg_type);
		motg->ui_enabled = 1;
		enable_irq(motg->irq);
		if (motg->phy_irq)
			enable_irq(motg->phy_irq);
		return -EBUSY;
	}

@@ -1456,6 +1460,8 @@ phcd_retry:
	/* Enable ASYNC IRQ (if present) during LPM */
	if (motg->async_irq)
		enable_irq(motg->async_irq);
	if (motg->phy_irq)
		enable_irq(motg->phy_irq);

	/* XO shutdown during idle , non wakeable irqs must be disabled */
	if (device_bus_suspend || host_bus_suspend || !motg->async_irq) {
@@ -1475,6 +1481,8 @@ phcd_retry:
phy_suspend_fail:
	motg->ui_enabled = 1;
	enable_irq(motg->irq);
	if (motg->phy_irq)
		enable_irq(motg->phy_irq);
	return ret;
}