public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Smartreflex: Avoid unnecessary spam
@ 2009-12-08 14:16 Tero Kristo
  2009-12-09 23:15 ` Kevin Hilman
  0 siblings, 1 reply; 6+ messages in thread
From: Tero Kristo @ 2009-12-08 14:16 UTC (permalink / raw)
  To: linux-omap

From: Tero Kristo <tero.kristo@nokia.com>

Current warning messages will be constantly printed out during normal operation
if smartreflex autocompensation is disabled.

Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
---
 arch/arm/mach-omap2/smartreflex.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index be3a1da..db228b2 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -675,13 +675,8 @@ void sr_start_vddautocomap(int srid, u32 target_opp_no)
 		sr_configure(sr);
 	}
 
-	if (sr->is_autocomp_active == 1)
-		pr_warning("SR%d: VDD autocomp is already active\n",
-									srid);
-
 	sr->is_autocomp_active = 1;
 	if (!sr_enable(sr, target_opp_no)) {
-		pr_warning("SR%d: VDD autocomp not activated\n", srid);
 		sr->is_autocomp_active = 0;
 		if (sr->is_sr_reset == 1)
 			sr_clk_disable(sr);
@@ -707,11 +702,8 @@ int sr_stop_vddautocomap(int srid)
 		/* Reset the volatage for current OPP */
 		sr_reset_voltage(srid);
 		return true;
-	} else {
-		pr_warning("SR%d: VDD autocomp is not active\n",
-								srid);
+	} else
 		return false;
-	}
 
 }
 EXPORT_SYMBOL(sr_stop_vddautocomap);
-- 
1.5.4.3


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

* Re: [PATCH] Smartreflex: Avoid unnecessary spam
  2009-12-08 14:16 [PATCH] Smartreflex: Avoid unnecessary spam Tero Kristo
@ 2009-12-09 23:15 ` Kevin Hilman
  2009-12-09 23:21   ` Nishanth Menon
  2009-12-09 23:23   ` Felipe Balbi
  0 siblings, 2 replies; 6+ messages in thread
From: Kevin Hilman @ 2009-12-09 23:15 UTC (permalink / raw)
  To: Tero Kristo; +Cc: linux-omap

Tero Kristo <tero.kristo@nokia.com> writes:

> From: Tero Kristo <tero.kristo@nokia.com>
>
> Current warning messages will be constantly printed out during normal operation
> if smartreflex autocompensation is disabled.
>
> Signed-off-by: Tero Kristo <tero.kristo@nokia.com>

Agreed that these warnings are spam, but I think they should be
replaced by some one-time warning so at least there's a hint someplace
that SR is not actually being done on a platfrom.

Kevin

> ---
>  arch/arm/mach-omap2/smartreflex.c |   10 +---------
>  1 files changed, 1 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
> index be3a1da..db228b2 100644
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -675,13 +675,8 @@ void sr_start_vddautocomap(int srid, u32 target_opp_no)
>  		sr_configure(sr);
>  	}
>  
> -	if (sr->is_autocomp_active == 1)
> -		pr_warning("SR%d: VDD autocomp is already active\n",
> -									srid);
> -
>  	sr->is_autocomp_active = 1;
>  	if (!sr_enable(sr, target_opp_no)) {
> -		pr_warning("SR%d: VDD autocomp not activated\n", srid);
>  		sr->is_autocomp_active = 0;
>  		if (sr->is_sr_reset == 1)
>  			sr_clk_disable(sr);
> @@ -707,11 +702,8 @@ int sr_stop_vddautocomap(int srid)
>  		/* Reset the volatage for current OPP */
>  		sr_reset_voltage(srid);
>  		return true;
> -	} else {
> -		pr_warning("SR%d: VDD autocomp is not active\n",
> -								srid);
> +	} else
>  		return false;
> -	}
>  
>  }
>  EXPORT_SYMBOL(sr_stop_vddautocomap);
> -- 
> 1.5.4.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] Smartreflex: Avoid unnecessary spam
  2009-12-09 23:15 ` Kevin Hilman
@ 2009-12-09 23:21   ` Nishanth Menon
  2009-12-09 23:23   ` Felipe Balbi
  1 sibling, 0 replies; 6+ messages in thread
From: Nishanth Menon @ 2009-12-09 23:21 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: Tero Kristo, linux-omap@vger.kernel.org

Kevin Hilman had written, on 12/09/2009 05:15 PM, the following:
> Tero Kristo <tero.kristo@nokia.com> writes:
> 
>> From: Tero Kristo <tero.kristo@nokia.com>
>>
>> Current warning messages will be constantly printed out during normal operation
>> if smartreflex autocompensation is disabled.
>>
>> Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
> 
> Agreed that these warnings are spam, but I think they should be
> replaced by some one-time warning so at least there's a hint someplace
> that SR is not actually being done on a platfrom.

is'nt that already taken care?
echo -n 1 >/sys/power/vdd1_autocomp; echo $?
should return a non 0 value if it was not set, else should set 0 if it 
went ok.

if someone wants to verify the state, it should be a cat 
/sys/power/vdd1_autocomp to know if autocomp was set or not.

For some userspace to know if autocomp was set or not (if I understand 
your intention) should look at return value like normal linux commands.

> 
> Kevin
> 
>> ---
>>  arch/arm/mach-omap2/smartreflex.c |   10 +---------
>>  1 files changed, 1 insertions(+), 9 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
>> index be3a1da..db228b2 100644
>> --- a/arch/arm/mach-omap2/smartreflex.c
>> +++ b/arch/arm/mach-omap2/smartreflex.c
>> @@ -675,13 +675,8 @@ void sr_start_vddautocomap(int srid, u32 target_opp_no)
>>  		sr_configure(sr);
>>  	}
>>  
>> -	if (sr->is_autocomp_active == 1)
>> -		pr_warning("SR%d: VDD autocomp is already active\n",
>> -									srid);
>> -
>>  	sr->is_autocomp_active = 1;
>>  	if (!sr_enable(sr, target_opp_no)) {
>> -		pr_warning("SR%d: VDD autocomp not activated\n", srid);
>>  		sr->is_autocomp_active = 0;
>>  		if (sr->is_sr_reset == 1)
>>  			sr_clk_disable(sr);
>> @@ -707,11 +702,8 @@ int sr_stop_vddautocomap(int srid)
>>  		/* Reset the volatage for current OPP */
>>  		sr_reset_voltage(srid);
>>  		return true;
>> -	} else {
>> -		pr_warning("SR%d: VDD autocomp is not active\n",
>> -								srid);
>> +	} else
>>  		return false;
>> -	}
>>  
>>  }
>>  EXPORT_SYMBOL(sr_stop_vddautocomap);
>> -- 
>> 1.5.4.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Regards,
Nishanth Menon

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

* Re: [PATCH] Smartreflex: Avoid unnecessary spam
  2009-12-09 23:15 ` Kevin Hilman
  2009-12-09 23:21   ` Nishanth Menon
@ 2009-12-09 23:23   ` Felipe Balbi
  2009-12-09 23:47     ` Nishanth Menon
  1 sibling, 1 reply; 6+ messages in thread
From: Felipe Balbi @ 2009-12-09 23:23 UTC (permalink / raw)
  To: ext Kevin Hilman
  Cc: Kristo Tero (Nokia-D/Tampere), linux-omap@vger.kernel.org

On Thu, Dec 10, 2009 at 12:15:26AM +0100, ext Kevin Hilman wrote:
>Tero Kristo <tero.kristo@nokia.com> writes:
>
>> From: Tero Kristo <tero.kristo@nokia.com>
>>
>> Current warning messages will be constantly printed out during normal operation
>> if smartreflex autocompensation is disabled.
>>
>> Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
>
>Agreed that these warnings are spam, but I think they should be
>replaced by some one-time warning so at least there's a hint someplace
>that SR is not actually being done on a platfrom.

well, there's printk_once()

include/linux/kernel.h:

250 /*       
251  * Print a one-time message (analogous to WARN_ONCE() et al):
252  */                  
253 #define printk_once(x...) ({                    \
254         static bool __print_once = true;        \
255                                                 \
256         if (__print_once) {                     \
257                 __print_once = false;           \
258                 printk(x);                      \
259         }                                       \
260 })

and WARN_ONCE()

include/asm-generic/bug.h:

125 #define WARN_ONCE(condition, format...) ({                      \
126         static int __warned;                                    \
127         int __ret_warn_once = !!(condition);                    \
128                                                                 \
129         if (unlikely(__ret_warn_once))                          \
130                 if (WARN(!__warned, format))                    \
131                         __warned = 1;                           \
132         unlikely(__ret_warn_once);                              \
133 })

I guess printk_once() is better.

-- 
balbi

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

* Re: [PATCH] Smartreflex: Avoid unnecessary spam
  2009-12-09 23:23   ` Felipe Balbi
@ 2009-12-09 23:47     ` Nishanth Menon
  2009-12-09 23:51       ` Kevin Hilman
  0 siblings, 1 reply; 6+ messages in thread
From: Nishanth Menon @ 2009-12-09 23:47 UTC (permalink / raw)
  To: felipe.balbi@nokia.com
  Cc: ext Kevin Hilman, Kristo Tero (Nokia-D/Tampere),
	linux-omap@vger.kernel.org

Felipe Balbi had written, on 12/09/2009 05:23 PM, the following:
> On Thu, Dec 10, 2009 at 12:15:26AM +0100, ext Kevin Hilman wrote:
>> Tero Kristo <tero.kristo@nokia.com> writes:
>>
>>> From: Tero Kristo <tero.kristo@nokia.com>
>>>
>>> Current warning messages will be constantly printed out during normal operation
>>> if smartreflex autocompensation is disabled.
>>>
>>> Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
>> Agreed that these warnings are spam, but I think they should be
>> replaced by some one-time warning so at least there's a hint someplace
>> that SR is not actually being done on a platfrom.
> 
> well, there's printk_once()
> 
> include/linux/kernel.h:
> 
> 250 /*       
> 251  * Print a one-time message (analogous to WARN_ONCE() et al):
> 252  */                  
> 253 #define printk_once(x...) ({                    \
> 254         static bool __print_once = true;        \
> 255                                                 \
> 256         if (__print_once) {                     \
> 257                 __print_once = false;           \
> 258                 printk(x);                      \
> 259         }                                       \
> 260 })
> 
> and WARN_ONCE()
> 
> include/asm-generic/bug.h:
> 
> 125 #define WARN_ONCE(condition, format...) ({                      \
> 126         static int __warned;                                    \
> 127         int __ret_warn_once = !!(condition);                    \
> 128                                                                 \
> 129         if (unlikely(__ret_warn_once))                          \
> 130                 if (WARN(!__warned, format))                    \
> 131                         __warned = 1;                           \
> 132         unlikely(__ret_warn_once);                              \
> 133 })
> 
> I guess printk_once() is better.
> 
But what is the point in having it?
situation 1:
sr_start_vddautocomap() gets called for starting AVS while dvfs. The 
spam message just warns user that autocomp is not set when OPP change 
happens.

case 1 against printing it:
If the user had disabled vddautocomp, then the warnings have no rational 
in warning the user which he/she already knows about.

case 2 against printing it using printk_once:
situation x:
step 1: autocomp disabled, dvfs transitions -> printk_once will print 
only once.
step 2: autocomp enabled, dvfs transitions - no prints.
step 3: autocomp disabled, dvfs - we wont see prints :(
Agreed, we could have an equivalent implementation using a static bool 
instead of using printk_once .. still a nuisance message which does not 
provide additional info.. other than adding a latency overhead.

situation 2:
when attempting to enable SR when nvalues are not present (e.g. on 
3530/3430 es3.0).. here the return value should be used and is more 
informative and usable from a application perspective..

just my 2 cents..

-- 
Regards,
Nishanth Menon

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

* Re: [PATCH] Smartreflex: Avoid unnecessary spam
  2009-12-09 23:47     ` Nishanth Menon
@ 2009-12-09 23:51       ` Kevin Hilman
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2009-12-09 23:51 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: felipe.balbi@nokia.com, Kristo Tero (Nokia-D/Tampere),
	linux-omap@vger.kernel.org

Nishanth Menon <nm@ti.com> writes:

> Felipe Balbi had written, on 12/09/2009 05:23 PM, the following:
>> On Thu, Dec 10, 2009 at 12:15:26AM +0100, ext Kevin Hilman wrote:
>>> Tero Kristo <tero.kristo@nokia.com> writes:
>>>
>>>> From: Tero Kristo <tero.kristo@nokia.com>
>>>>
>>>> Current warning messages will be constantly printed out during normal operation
>>>> if smartreflex autocompensation is disabled.
>>>>
>>>> Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
>>> Agreed that these warnings are spam, but I think they should be
>>> replaced by some one-time warning so at least there's a hint someplace
>>> that SR is not actually being done on a platfrom.
>>
>> well, there's printk_once()
>>
>> include/linux/kernel.h:
>>
>> 250 /*       251  * Print a one-time message (analogous to
>> WARN_ONCE() et al):
>> 252  */                  253 #define printk_once(x...) ({
>> \
>> 254         static bool __print_once = true;        \
>> 255                                                 \
>> 256         if (__print_once) {                     \
>> 257                 __print_once = false;           \
>> 258                 printk(x);                      \
>> 259         }                                       \
>> 260 })
>>
>> and WARN_ONCE()
>>
>> include/asm-generic/bug.h:
>>
>> 125 #define WARN_ONCE(condition, format...) ({                      \
>> 126         static int __warned;                                    \
>> 127         int __ret_warn_once = !!(condition);                    \
>> 128                                                                 \
>> 129         if (unlikely(__ret_warn_once))                          \
>> 130                 if (WARN(!__warned, format))                    \
>> 131                         __warned = 1;                           \
>> 132         unlikely(__ret_warn_once);                              \
>> 133 })
>>
>> I guess printk_once() is better.
>>
> But what is the point in having it?
> situation 1:
> sr_start_vddautocomap() gets called for starting AVS while dvfs. The
> spam message just warns user that autocomp is not set when OPP change
> happens.
>
> case 1 against printing it:
> If the user had disabled vddautocomp, then the warnings have no
> rational in warning the user which he/she already knows about.
>
> case 2 against printing it using printk_once:
> situation x:
> step 1: autocomp disabled, dvfs transitions -> printk_once will print
> only once.
> step 2: autocomp enabled, dvfs transitions - no prints.
> step 3: autocomp disabled, dvfs - we wont see prints :(
> Agreed, we could have an equivalent implementation using a static bool
> instead of using printk_once .. still a nuisance message which does
> not provide additional info.. other than adding a latency overhead.
>
> situation 2:
> when attempting to enable SR when nvalues are not present (e.g. on
> 3530/3430 es3.0).. here the return value should be used and is more
> informative and usable from a application perspective..
>
> just my 2 cents..

OK, I'm sold.  

Applying Tero's original patch.

Kevin



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

end of thread, other threads:[~2009-12-09 23:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-08 14:16 [PATCH] Smartreflex: Avoid unnecessary spam Tero Kristo
2009-12-09 23:15 ` Kevin Hilman
2009-12-09 23:21   ` Nishanth Menon
2009-12-09 23:23   ` Felipe Balbi
2009-12-09 23:47     ` Nishanth Menon
2009-12-09 23:51       ` Kevin Hilman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox