Skip to contentSkip to conversation

OMAP: hwmod: Update the sysc_cache in case module context is lost

PATCH In review Rajendra Nayak 2 participants 2 messages Oct 26, 2010 – Nov 9, 2010

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 OMAP: hwmod: Update the sysc_cache in case module context is lost

Do not skip the sysc programming in the hmwod framework based on the cached value alone, since at times the module might have lost context (due to the Powerdomain in which the module belongs transitions to either Open Switch RET or OFF).

Identifying if a module has lost context requires atleast one register read, and since a register read has more latency than a write, it makes sense to do a blind write always.

Cc Paul Walmsley <[email protected]>
Cc Benoit Cousson <[email protected]>
Cc Santosh Shilimkar <[email protected]>
Cc Kevin Hilman <[email protected]>
---
 arch/arm/mach-omap2/omap_hwmod.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +3 -4
index 5a30658..aadd6dc 100644
@@ -209,10 +209,9 @@ static void _write_sysconfig(u32 v, struct omap_hwmod *oh)
 
 	/* XXX ensure module interface clock is up */
 
-	if (oh->_sysc_cache != v) {
-		oh->_sysc_cache = v;
-		omap_hwmod_write(v, oh, oh->class->sysc->sysc_offs);
-	}
+	/* Module might have lost context, always update cache and register */
+	oh->_sysc_cache = v;
+	omap_hwmod_write(v, oh, oh->class->sysc->sysc_offs);
 }
 
 /**
Signature · 1 line
1.7.0.4
Acked-by on v2 1/1
#1 lore raw
Quoted 9 lines · Rajendra Nayak

Do not skip the sysc programming in the hmwod framework based on the cached value alone, since at times the module might have lost context (due to the Powerdomain in which the module belongs transitions to either Open Switch RET or OFF).

Identifying if a module has lost context requires atleast one register read, and since a register read has more latency than a write, it makes sense to do a blind write always.

Quoted 5 lines
Cc Paul Walmsley <[email protected]>
Cc Benoit Cousson <[email protected]>
Cc Santosh Shilimkar <[email protected]>
Cc Kevin Hilman <[email protected]>
Quoted 22 lines
---
 arch/arm/mach-omap2/omap_hwmod.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +3 -4
index 5a30658..aadd6dc 100644
@@ -209,10 +209,9 @@ static void _write_sysconfig(u32 v, struct omap_hwmod *oh)
 
 	/* XXX ensure module interface clock is up */
 
-	if (oh->_sysc_cache != v) {
-		oh->_sysc_cache = v;
-		omap_hwmod_write(v, oh, oh->class->sysc->sysc_offs);
-	}
+	/* Module might have lost context, always update cache and register */
+	oh->_sysc_cache = v;
+	omap_hwmod_write(v, oh, oh->class->sysc->sysc_offs);
 }
 
 /**