lkml.org 
[lkml]   [2006]   [May]   [2]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] timer TSC check suspend notifier change
FromAndi Kleen <>
Date02 May 2006 08:36:59 +0200
Shaohua Li <shaohua.li@intel.com> writes:

> in suspend time, the TSC CPUFREQ_SUSPENDCHANGE notifier change might wrongly
> enable interrupt. cpufreq driver suspend/resume is in interrupt disabled environment.
> 
> Signed-off-by: Shaohua Li <shaohua.li@intel.com>
> ---
> 
>  linux-2.6.17-rc3-root/arch/i386/kernel/timers/timer_tsc.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff -puN arch/i386/kernel/timers/timer_tsc.c~timer_tsc_check_suspend_change arch/i386/kernel/timers/timer_tsc.c
> --- linux-2.6.17-rc3/arch/i386/kernel/timers/timer_tsc.c~timer_tsc_check_suspend_change	2006-04-29 08:25:38.000000000 +0800
> +++ linux-2.6.17-rc3-root/arch/i386/kernel/timers/timer_tsc.c	2006-04-29 08:29:33.000000000 +0800
> @@ -279,7 +279,7 @@ time_cpufreq_notifier(struct notifier_bl
>  {
>  	struct cpufreq_freqs *freq = data;
> 
> -	if (val != CPUFREQ_RESUMECHANGE)
> +	if (val != CPUFREQ_RESUMECHANGE && val != CPUFREQ_SUSPENDCHANGE)
>  		write_seqlock_irq(&xtime_lock);

Better would be to change it to write_seqlock_irqsave() (if that 
exists, if not add it) 


>  	if (!ref_freq) {
>  		if (!freq->old){
> @@ -312,7 +312,7 @@ time_cpufreq_notifier(struct notifier_bl
>  	}
> 
>  end:
> -	if (val != CPUFREQ_RESUMECHANGE)
> +	if (val != CPUFREQ_RESUMECHANGE && val != CPUFREQ_SUSPENDCHANGE)
>  		write_sequnlock_irq(&xtime_lock);

and _restore

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-05-02 08:39    [from the cache]
©2003-2008