提交 f59de563 编写于 作者: C Chris Brandt 提交者: Stephen Boyd

clk: renesas: mstp: ensure register writes complete

When there is no status bit, it is possible for the clock enable/disable
operation to have not completed by the time the driver code resumes
execution. This is due to the fact that write operations are sometimes
queued and delayed internally. Doing a read ensures the write operations
has completed.

Fixes: b6face40 ("ARM: shmobile: r7s72100: add essential clock nodes to dtsi")
Signed-off-by: NChris Brandt <chris.brandt@renesas.com>
Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
上级 6ff8ec98
...@@ -91,6 +91,12 @@ static int cpg_mstp_clock_endisable(struct clk_hw *hw, bool enable) ...@@ -91,6 +91,12 @@ static int cpg_mstp_clock_endisable(struct clk_hw *hw, bool enable)
value |= bitmask; value |= bitmask;
cpg_mstp_write(group, value, group->smstpcr); cpg_mstp_write(group, value, group->smstpcr);
if (!group->mstpsr) {
/* dummy read to ensure write has completed */
cpg_mstp_read(group, group->smstpcr);
barrier_data(group->smstpcr);
}
spin_unlock_irqrestore(&group->lock, flags); spin_unlock_irqrestore(&group->lock, flags);
if (!enable || !group->mstpsr) if (!enable || !group->mstpsr)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册