]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.9/arm-omap2-hwmod-fix-updating-of-sysconfig-register.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.9 / arm-omap2-hwmod-fix-updating-of-sysconfig-register.patch
CommitLineData
27d1c9b7
GKH
1From 3ca4a238106dedc285193ee47f494a6584b6fd2f Mon Sep 17 00:00:00 2001
2From: Lokesh Vutla <lokeshvutla@ti.com>
3Date: Sat, 26 Mar 2016 23:08:55 -0600
4Subject: ARM: OMAP2+: hwmod: Fix updating of sysconfig register
5
6From: Lokesh Vutla <lokeshvutla@ti.com>
7
8commit 3ca4a238106dedc285193ee47f494a6584b6fd2f upstream.
9
10Commit 127500ccb766f ("ARM: OMAP2+: Only write the sysconfig on idle
11when necessary") talks about verification of sysconfig cache value before
12updating it, only during idle path. But the patch is adding the
13verification in the enable path. So, adding the check in a proper place
14as per the commit description.
15
16Not keeping this check during enable path as there is a chance of losing
17context and it is safe to do on idle as the context of the register will
18never be lost while the device is active.
19
20Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
21Acked-by: Tero Kristo <t-kristo@ti.com>
22Cc: Jon Hunter <jonathanh@nvidia.com>
23Fixes: commit 127500ccb766 "ARM: OMAP2+: Only write the sysconfig on idle when necessary"
24[paul@pwsan.com: appears to have been caused by my own mismerge of the
25 originally posted patch]
26Signed-off-by: Paul Walmsley <paul@pwsan.com>
27Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
28
29---
30 arch/arm/mach-omap2/omap_hwmod.c | 8 ++++----
31 1 file changed, 4 insertions(+), 4 deletions(-)
32
33--- a/arch/arm/mach-omap2/omap_hwmod.c
34+++ b/arch/arm/mach-omap2/omap_hwmod.c
35@@ -1416,9 +1416,7 @@ static void _enable_sysc(struct omap_hwm
36 (sf & SYSC_HAS_CLOCKACTIVITY))
37 _set_clockactivity(oh, oh->class->sysc->clockact, &v);
38
39- /* If the cached value is the same as the new value, skip the write */
40- if (oh->_sysc_cache != v)
41- _write_sysconfig(v, oh);
42+ _write_sysconfig(v, oh);
43
44 /*
45 * Set the autoidle bit only after setting the smartidle bit
46@@ -1481,7 +1479,9 @@ static void _idle_sysc(struct omap_hwmod
47 _set_master_standbymode(oh, idlemode, &v);
48 }
49
50- _write_sysconfig(v, oh);
51+ /* If the cached value is the same as the new value, skip the write */
52+ if (oh->_sysc_cache != v)
53+ _write_sysconfig(v, oh);
54 }
55
56 /**