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

Commit 9a72294c authored by Vijayavardhan Vennapusa's avatar Vijayavardhan Vennapusa
Browse files

USB: dwc3: msm: Kill tasklet before disabling irq in suspend



If tasklet dwc->bh and dwc3_msm_suspend() race each other, there is
chance that clocks are turned off as part of suspend() and end up
accessing registers as part of bottom half handler. This results in
crash. Fix this by killing tasklet before disabling irq as part of
suspend() so that tasklet gets completed if it is pending.

Change-Id: I63775dd27fedc0026d6edc6a76ec93e4581be644
Signed-off-by: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
parent ca3a3f54
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1961,6 +1961,7 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc)
	can_suspend_ssphy = !(mdwc->in_host_mode &&
				dwc3_msm_is_host_superspeed(mdwc));

	tasklet_kill(&dwc->bh);
	/* Disable core irq */
	if (dwc->irq)
		disable_irq(dwc->irq);
+0 −2
Original line number Diff line number Diff line
@@ -3503,7 +3503,6 @@ static void dwc3_interrupt_bh(unsigned long param)
{
	struct dwc3 *dwc = (struct dwc3 *) param;

	pm_runtime_get(dwc->dev);
	dwc3_thread_interrupt(dwc->irq, dwc);
	enable_irq(dwc->irq);
}
@@ -3531,7 +3530,6 @@ static irqreturn_t dwc3_thread_interrupt(int irq, void *_dwc)
	dwc->bh_completion_time[dwc->bh_dbg_index] = temp_time;
	dwc->bh_dbg_index = (dwc->bh_dbg_index + 1) % 10;

	pm_runtime_put(dwc->dev);
	return ret;
}