diff options
| author | Mayank Rana <mrana@codeaurora.org> | 2016-02-04 11:11:42 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-08-16 14:59:52 -0700 |
| commit | 3fb072e4a7fa07e3003d46f2d4e014790135fbf2 (patch) | |
| tree | 7a78e04f3d8454dffb9ff6994cb01f7c2bfc94dc | |
| parent | c5984ec85c1e095f932f2fdaf5f327a2c1480c9b (diff) | |
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: Mayank Rana <mrana@codeaurora.org>
| -rw-r--r-- | drivers/usb/phy/phy-msm-ssusb-qmp.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/phy/phy-msm-ssusb-qmp.c b/drivers/usb/phy/phy-msm-ssusb-qmp.c index 794bc2e33695..529e4ea76a96 100644 --- a/drivers/usb/phy/phy-msm-ssusb-qmp.c +++ b/drivers/usb/phy/phy-msm-ssusb-qmp.c @@ -465,6 +465,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); @@ -494,6 +497,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"); } |
