Skip to contentSkip to conversation

ARM: OMAP2+: Fix updating of sysconfig register

RFC PATCH New Lokesh Vutla 4 participants 5 messages Mar 1, 2016 – Mar 8, 2016

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

RFC PATCH 1/1 ARM: OMAP2+: Fix updating of sysconfig register

commit 127500ccb766f ("ARM: OMAP2+: Only write the sysconfig on idle when necessary") talks about verification of sysconfig cache value before updating it, only during idle path. But the patch is adding the verification in the enable path. So, adding the check in a proper place as per the commit description.

Not keeping this check during enable path as there is a chance of losing context and it is safe to do on idle as the context of the register will never be lost while the device is active.

---
 arch/arm/mach-omap2/omap_hwmod.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +4 -4
index e9f65fe..71b3747 100644
@@ -1416,9 +1416,7 @@ static void _enable_sysc(struct omap_hwmod *oh)
 	    (sf & SYSC_HAS_CLOCKACTIVITY))
 		_set_clockactivity(oh, oh->class->sysc->clockact, &v);
 
-	/* If the cached value is the same as the new value, skip the write */
-	if (oh->_sysc_cache != v)
-		_write_sysconfig(v, oh);
+	_write_sysconfig(v, oh);
 
 	/*
 	 * Set the autoidle bit only after setting the smartidle bit
@@ -1481,7 +1479,9 @@ static void _idle_sysc(struct omap_hwmod *oh)
 		_set_master_standbymode(oh, idlemode, &v);
 	}
 
-	_write_sysconfig(v, oh);
+	/* If the cached value is the same as the new value, skip the write */
+	if (oh->_sysc_cache != v)
+		_write_sysconfig(v, oh);
 }
 
 /**
Signature · 1 line
2.1.4
maintainer
#1 lore raw

RFC PATCH 1/1 ARM: OMAP2+: Fix updating of sysconfig register

+ Jon Hunter

Quoted 44 lines · Lokesh Vutla

commit 127500ccb766f ("ARM: OMAP2+: Only write the sysconfig on idle when necessary") talks about verification of sysconfig cache value before updating it, only during idle path. But the patch is adding the verification in the enable path. So, adding the check in a proper place as per the commit description.

Not keeping this check during enable path as there is a chance of losing context and it is safe to do on idle as the context of the register will never be lost while the device is active.

---
 arch/arm/mach-omap2/omap_hwmod.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +4 -4
index e9f65fe..71b3747 100644
@@ -1416,9 +1416,7 @@ static void _enable_sysc(struct omap_hwmod *oh)
 	    (sf & SYSC_HAS_CLOCKACTIVITY))
 		_set_clockactivity(oh, oh->class->sysc->clockact, &v);
 
-	/* If the cached value is the same as the new value, skip the write */
-	if (oh->_sysc_cache != v)
-		_write_sysconfig(v, oh);
+	_write_sysconfig(v, oh);
 
 	/*
 	 * Set the autoidle bit only after setting the smartidle bit
@@ -1481,7 +1479,9 @@ static void _idle_sysc(struct omap_hwmod *oh)
 		_set_master_standbymode(oh, idlemode, &v);
 	}
 
-	_write_sysconfig(v, oh);
+	/* If the cached value is the same as the new value, skip the write */
+	if (oh->_sysc_cache != v)
+		_write_sysconfig(v, oh);
 }
 
 /**
Signature · 1 line
2.1.4

- Paul

#2 lore raw

RFC PATCH 1/1 ARM: OMAP2+: Fix updating of sysconfig register

Quoted 13 lines · Paul Walmsley

+ Jon Hunter

Quoted 9 lines · Lokesh Vutla

commit 127500ccb766f ("ARM: OMAP2+: Only write the sysconfig on idle when necessary") talks about verification of sysconfig cache value before updating it, only during idle path. But the patch is adding the verification in the enable path. So, adding the check in a proper place as per the commit description.

Not keeping this check during enable path as there is a chance of losing context and it is safe to do on idle as the context of the register will never be lost while the device is active.

When the patch was originally posted[1], this check was in proper place itself. Not sure what happened after that.

[1] https://www.mail-archive.com/linux-omap%40vger.kernel.org/msg78032.html

Thanks and regards,
Lokesh

Quoted 39 lines
Quoted 35 lines
---
 arch/arm/mach-omap2/omap_hwmod.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +4 -4
index e9f65fe..71b3747 100644
@@ -1416,9 +1416,7 @@ static void _enable_sysc(struct omap_hwmod *oh)
 	    (sf & SYSC_HAS_CLOCKACTIVITY))
 		_set_clockactivity(oh, oh->class->sysc->clockact, &v);
 
-	/* If the cached value is the same as the new value, skip the write */
-	if (oh->_sysc_cache != v)
-		_write_sysconfig(v, oh);
+	_write_sysconfig(v, oh);
 
 	/*
 	 * Set the autoidle bit only after setting the smartidle bit
@@ -1481,7 +1479,9 @@ static void _idle_sysc(struct omap_hwmod *oh)
 		_set_master_standbymode(oh, idlemode, &v);
 	}
 
-	_write_sysconfig(v, oh);
+	/* If the cached value is the same as the new value, skip the write */
+	if (oh->_sysc_cache != v)
+		_write_sysconfig(v, oh);
 }
 
 /**
Signature · 1 line
2.1.4

- Paul

#3 lore raw

RFC PATCH 1/1 ARM: OMAP2+: Fix updating of sysconfig register

Quoted 13 lines · Lokesh Vutla
Quoted 10 lines · Paul Walmsley

+ Jon Hunter

Quoted 6 lines · Lokesh Vutla

commit 127500ccb766f ("ARM: OMAP2+: Only write the sysconfig on idle when necessary") talks about verification of sysconfig cache value before updating it, only during idle path. But the patch is adding the verification in the enable path. So, adding the check in a proper place as per the commit description.

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

Not keeping this check during enable path as there is a chance of losing context and it is safe to do on idle as the context of the register will never be lost while the device is active.

When the patch was originally posted[1], this check was in proper place itself. Not sure what happened after that.

Looks like a merge conflict to me.

The patch from Lokesh fixes it, so:

Quoted 45 lines

[1] https://www.mail-archive.com/linux-omap%40vger.kernel.org/msg78032.html

Thanks and regards,
Lokesh

Quoted 39 lines
Quoted 33 lines
---
  arch/arm/mach-omap2/omap_hwmod.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +4 -5
index e9f65fe..71b3747 100644
@@ -1416,9 +1416,7 @@ static void _enable_sysc(struct omap_hwmod *oh)
  	    (sf & SYSC_HAS_CLOCKACTIVITY))
  		_set_clockactivity(oh, oh->class->sysc->clockact, &v);
 
-	/* If the cached value is the same as the new value, skip the write */
-	if (oh->_sysc_cache != v)
-		_write_sysconfig(v, oh);
+	_write_sysconfig(v, oh);
 
  	/*
  	 * Set the autoidle bit only after setting the smartidle bit
@@ -1481,7 +1479,9 @@ static void _idle_sysc(struct omap_hwmod *oh)
  		_set_master_standbymode(oh, idlemode, &v);
  	}
 
-	_write_sysconfig(v, oh);
+	/* If the cached value is the same as the new value, skip the write */
+	if (oh->_sysc_cache != v)
+		_write_sysconfig(v, oh);
  }
 
  /**
--
Quoted 2 lines

2.1.4

- Paul

maintainer
#4 lore raw

RFC PATCH 1/1 ARM: OMAP2+: Fix updating of sysconfig register

Quoted 17 lines · Tero Kristo
Quoted 16 lines · Lokesh Vutla
Quoted 14 lines · Paul Walmsley

+ Jon Hunter

Quoted 10 lines · Lokesh Vutla

commit 127500ccb766f ("ARM: OMAP2+: Only write the sysconfig on idle when necessary") talks about verification of sysconfig cache value before
updating it, only during idle path. But the patch is adding the verification in the enable path. So, adding the check in a proper place as per the commit description.

Not keeping this check during enable path as there is a chance of losing context and it is safe to do on idle as the context of the register will never be lost while the device is active.

Quoted 8 lines
Quoted 2 lines

When the patch was originally posted[1], this check was in proper place itself. Not sure what happened after that.

Looks like a merge conflict to me.

The patch from Lokesh fixes it, so:

Yep, this one looks like I (accidentally) caused this one.

Will queue the following patch for v4.6-rc.

- Paul

From: Lokesh Vutla <[email protected]>
Date: Tue, 1 Mar 2016 17:18:07 +0530
Subject: [PATCH] ARM: OMAP2+: hwmod: Fix updating of sysconfig register

Commit 127500ccb766f ("ARM: OMAP2+: Only write the sysconfig on idle when necessary") talks about verification of sysconfig cache value before updating it, only during idle path. But the patch is adding the verification in the enable path. So, adding the check in a proper place as per the commit description.

Not keeping this check during enable path as there is a chance of losing context and it is safe to do on idle as the context of the register will never be lost while the device is active.

Cc Jon Hunter <[email protected]>
Cc <[email protected]> # 3.12+
Fixes commit 127500ccb766 "ARM: OMAP2+: Only write the sysconfig on idle when necessary"

[paul at pwsan.com: appears to have been caused by my own mismerge of the
originally posted patch]

---
 arch/arm/mach-omap2/omap_hwmod.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +4 -4
index e9f65fec55c0..71b374790c76 100644
@@ -1416,9 +1416,7 @@ static void _enable_sysc(struct omap_hwmod *oh)
 	    (sf & SYSC_HAS_CLOCKACTIVITY))
 		_set_clockactivity(oh, oh->class->sysc->clockact, &v);
 
-	/* If the cached value is the same as the new value, skip the write */
-	if (oh->_sysc_cache != v)
-		_write_sysconfig(v, oh);
+	_write_sysconfig(v, oh);
 
 	/*
 	 * Set the autoidle bit only after setting the smartidle bit
@@ -1481,7 +1479,9 @@ static void _idle_sysc(struct omap_hwmod *oh)
 		_set_master_standbymode(oh, idlemode, &v);
 	}
 
-	_write_sysconfig(v, oh);
+	/* If the cached value is the same as the new value, skip the write */
+	if (oh->_sysc_cache != v)
+		_write_sysconfig(v, oh);
 }
 
 /**
Signature · 1 line
2.7.0