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

Commit 813952b4 authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: qmp: phy: Make sure QMP PHY write completed



Add explicit write memory barrier before turning off QMP PHY clock to
make sure previous POWER DOWN operation (in disconnect case) or
putting PHY into autonomous mode (in suspend case) is completed.
Similar way add write memory barrier after performing POWER UP
operation (in connect case) or disabling PHY autonomous mode (in
resume case).

Change-Id: I91bb098506eb0c7d5dd6248fad71b8bb9186ea5a
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 741b9664
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -448,6 +448,9 @@ static int msm_ssphy_qmp_set_suspend(struct usb_phy *uphy, int suspend)
		else
			msm_ssusb_qmp_enable_autonomous(phy, 1);

		/* Make sure above write completed with PHY */
		wmb();

		clk_disable_unprepare(phy->cfg_ahb_clk);
		clk_disable_unprepare(phy->aux_clk);
		clk_disable_unprepare(phy->pipe_clk);
@@ -477,6 +480,10 @@ static int msm_ssphy_qmp_set_suspend(struct usb_phy *uphy, int suspend)
		} else  {
			msm_ssusb_qmp_enable_autonomous(phy, 0);
		}

		/* Make sure that above write completed with PHY */
		wmb();

		phy->in_suspend = false;
		dev_dbg(uphy->dev, "QMP PHY is resumed\n");
	}