diff options
author | Chris Brandt <chris.brandt@renesas.com> | 2017-02-14 11:08:05 -0500 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2017-06-05 21:17:10 +0100 |
commit | 12984626c78535f50f8b481f32211613f571eb48 (patch) | |
tree | 90c8b7ef4ad41347c3721e94676fc1aeeb491c23 /drivers | |
parent | be1aa88a64393289a11ba401de6b2bcfa8d9c503 (diff) | |
download | linux-stable-12984626c78535f50f8b481f32211613f571eb48.tar.gz linux-stable-12984626c78535f50f8b481f32211613f571eb48.tar.bz2 linux-stable-12984626c78535f50f8b481f32211613f571eb48.zip |
clk: renesas: mstp: ensure register writes complete
commit f59de563358eb9351b7f8f0ba2d3be2ebb70b93d upstream.
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: b6face404f38 ("ARM: shmobile: r7s72100: add essential clock nodes to dtsi")
Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
[bwh: Backported to 3.16:
- Use barrier() instead of barrier_data()
- Adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clk/shmobile/clk-mstp.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/clk/shmobile/clk-mstp.c b/drivers/clk/shmobile/clk-mstp.c index a9e02a38093e..2fa66c1c8a5d 100644 --- a/drivers/clk/shmobile/clk-mstp.c +++ b/drivers/clk/shmobile/clk-mstp.c @@ -85,6 +85,12 @@ static int cpg_mstp_clock_endisable(struct clk_hw *hw, bool enable) value |= bitmask; cpg_mstp_write(group, value, group->smstpcr); + if (!group->mstpsr) { + /* dummy read to ensure write has completed */ + cpg_mstp_read(group, group->smstpcr); + barrier(); + } + spin_unlock_irqrestore(&group->lock, flags); if (!enable || !group->mstpsr) |