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

Commit 4941b289 authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

USB: phy: Disable IRQs before resetting clocks



As a part of msm_otg_reset, we go for disabling and
enabling of clocks. There is a chance that IRQ may
get fired when the clocks are disabled. This may lead
to NOC error because of unclocked access when we try
to access some memory region as a part of IRQ handling.

Fix this by disabling IRQs before going for clock reset
and enable IRQs later.

Change-Id: I8ccec08c9c520f0573a2dbe1a9f8e780b3516e85
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent a74a42c2
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -746,12 +746,24 @@ static int msm_otg_reset(struct usb_phy *phy)
	}
	}
	motg->reset_counter++;
	motg->reset_counter++;


	disable_irq(motg->irq);
	if (motg->phy_irq)
		disable_irq(motg->phy_irq);

	ret = msm_otg_phy_reset(motg);
	ret = msm_otg_phy_reset(motg);
	if (ret) {
	if (ret) {
		dev_err(phy->dev, "phy_reset failed\n");
		dev_err(phy->dev, "phy_reset failed\n");
		if (motg->phy_irq)
			enable_irq(motg->phy_irq);

		enable_irq(motg->irq);
		return ret;
		return ret;
	}
	}


	if (motg->phy_irq)
		enable_irq(motg->phy_irq);

	enable_irq(motg->irq);
	ret = msm_otg_link_reset(motg);
	ret = msm_otg_link_reset(motg);
	if (ret) {
	if (ret) {
		dev_err(phy->dev, "link reset failed\n");
		dev_err(phy->dev, "link reset failed\n");