[PATCH] timer TSC check suspend notifier change
authorShaohua Li <shaohua.li@intel.com>
Mon, 1 May 2006 19:16:19 +0000 (12:16 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 2 May 2006 01:17:47 +0000 (18:17 -0700)
At 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>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/i386/kernel/timers/timer_tsc.c

index 5e41ee29c8cff1dff22ffd7142b7dfc96f9e3594..f1187ddb0d0fc07809a3f5f20ab43177b6fbe61f 100644 (file)
@@ -279,7 +279,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
 {
        struct cpufreq_freqs *freq = data;
 
-       if (val != CPUFREQ_RESUMECHANGE)
+       if (val != CPUFREQ_RESUMECHANGE && val != CPUFREQ_SUSPENDCHANGE)
                write_seqlock_irq(&xtime_lock);
        if (!ref_freq) {
                if (!freq->old){
@@ -312,7 +312,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
        }
 
 end:
-       if (val != CPUFREQ_RESUMECHANGE)
+       if (val != CPUFREQ_RESUMECHANGE && val != CPUFREQ_SUSPENDCHANGE)
                write_sequnlock_irq(&xtime_lock);
 
        return 0;