linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] ARM: OMAP2+: Fix updating of sysconfig register
@ 2016-03-01 11:48 Lokesh Vutla
  2016-03-01 17:03 ` Paul Walmsley
  0 siblings, 1 reply; 5+ messages in thread
From: Lokesh Vutla @ 2016-03-01 11:48 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index e9f65fe..71b3747 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -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);
 }
 
 /**
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RFC PATCH] ARM: OMAP2+: Fix updating of sysconfig register
  2016-03-01 11:48 [RFC PATCH] ARM: OMAP2+: Fix updating of sysconfig register Lokesh Vutla
@ 2016-03-01 17:03 ` Paul Walmsley
  2016-03-02  3:36   ` Lokesh Vutla
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Walmsley @ 2016-03-01 17:03 UTC (permalink / raw)
  To: linux-arm-kernel

+ Jon Hunter

On Tue, 1 Mar 2016, Lokesh Vutla wrote:

> 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.
> 
> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
> ---
>  arch/arm/mach-omap2/omap_hwmod.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
> index e9f65fe..71b3747 100644
> --- a/arch/arm/mach-omap2/omap_hwmod.c
> +++ b/arch/arm/mach-omap2/omap_hwmod.c
> @@ -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);
>  }
>  
>  /**
> -- 
> 2.1.4
> 


- Paul

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC PATCH] ARM: OMAP2+: Fix updating of sysconfig register
  2016-03-01 17:03 ` Paul Walmsley
@ 2016-03-02  3:36   ` Lokesh Vutla
  2016-03-02  7:38     ` Tero Kristo
  0 siblings, 1 reply; 5+ messages in thread
From: Lokesh Vutla @ 2016-03-02  3:36 UTC (permalink / raw)
  To: linux-arm-kernel



On Tuesday 01 March 2016 10:33 PM, Paul Walmsley wrote:
> + Jon Hunter
> 
> On Tue, 1 Mar 2016, Lokesh Vutla wrote:
> 
>> 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

>>
>> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
>> ---
>>  arch/arm/mach-omap2/omap_hwmod.c | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
>> index e9f65fe..71b3747 100644
>> --- a/arch/arm/mach-omap2/omap_hwmod.c
>> +++ b/arch/arm/mach-omap2/omap_hwmod.c
>> @@ -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);
>>  }
>>  
>>  /**
>> -- 
>> 2.1.4
>>
> 
> 
> - Paul
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC PATCH] ARM: OMAP2+: Fix updating of sysconfig register
  2016-03-02  3:36   ` Lokesh Vutla
@ 2016-03-02  7:38     ` Tero Kristo
  2016-03-08  7:01       ` Paul Walmsley
  0 siblings, 1 reply; 5+ messages in thread
From: Tero Kristo @ 2016-03-02  7:38 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/02/2016 05:36 AM, Lokesh Vutla wrote:
>
>
> On Tuesday 01 March 2016 10:33 PM, Paul Walmsley wrote:
>> + Jon Hunter
>>
>> On Tue, 1 Mar 2016, Lokesh Vutla wrote:
>>
>>> 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.

Looks like a merge conflict to me.

The patch from Lokesh fixes it, so:

Acked-by: Tero Kristo <t-kristo@ti.com>

>
> [1] https://www.mail-archive.com/linux-omap%40vger.kernel.org/msg78032.html
>
> Thanks and regards,
> Lokesh
>
>>>
>>> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
>>> ---
>>>   arch/arm/mach-omap2/omap_hwmod.c | 8 ++++----
>>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
>>> index e9f65fe..71b3747 100644
>>> --- a/arch/arm/mach-omap2/omap_hwmod.c
>>> +++ b/arch/arm/mach-omap2/omap_hwmod.c
>>> @@ -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);
>>>   }
>>>
>>>   /**
>>> --
>>> 2.1.4
>>>
>>
>>
>> - Paul
>>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC PATCH] ARM: OMAP2+: Fix updating of sysconfig register
  2016-03-02  7:38     ` Tero Kristo
@ 2016-03-08  7:01       ` Paul Walmsley
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Walmsley @ 2016-03-08  7:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2 Mar 2016, Tero Kristo wrote:

> On 03/02/2016 05:36 AM, Lokesh Vutla wrote:
> > On Tuesday 01 March 2016 10:33 PM, Paul Walmsley wrote:
> > > + Jon Hunter
> > > 
> > > On Tue, 1 Mar 2016, Lokesh Vutla wrote:
> > > 
> > > > 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.
> 
> Looks like a merge conflict to me.
> 
> The patch from Lokesh fixes it, so:
> 
> Acked-by: Tero Kristo <t-kristo@ti.com>

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

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


- Paul


From: Lokesh Vutla <lokeshvutla@ti.com>
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.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Acked-by: Tero Kristo <t-kristo@ti.com>
Cc: Jon Hunter <jonathanh@nvidia.com>
Cc: <stable@vger.kernel.org> # 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]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/mach-omap2/omap_hwmod.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index e9f65fec55c0..71b374790c76 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -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);
 }
 
 /**
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-03-08  7:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-01 11:48 [RFC PATCH] ARM: OMAP2+: Fix updating of sysconfig register Lokesh Vutla
2016-03-01 17:03 ` Paul Walmsley
2016-03-02  3:36   ` Lokesh Vutla
2016-03-02  7:38     ` Tero Kristo
2016-03-08  7:01       ` Paul Walmsley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).