[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1496331796.840689112@decadent.org.uk>
Date: Thu, 01 Jun 2017 16:43:16 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org,
"Geert Uytterhoeven" <geert+renesas@...der.be>,
"Stephen Boyd" <sboyd@...eaurora.org>,
"Chris Brandt" <chris.brandt@...esas.com>
Subject: [PATCH 3.16 132/212] clk: renesas: mstp: ensure register writes
complete
3.16.44-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Chris Brandt <chris.brandt@...esas.com>
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@...esas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
Signed-off-by: Stephen Boyd <sboyd@...eaurora.org>
[bwh: Backported to 3.16:
- Use barrier() instead of barrier_data()
- Adjust filename]
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
drivers/clk/shmobile/clk-mstp.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/clk/shmobile/clk-mstp.c
+++ b/drivers/clk/shmobile/clk-mstp.c
@@ -85,6 +85,12 @@ static int cpg_mstp_clock_endisable(stru
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)
Powered by blists - more mailing lists