]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Bug in timer_tsc cpufreq callback
authorVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Sat, 11 Oct 2003 12:58:58 +0000 (05:58 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Sat, 11 Oct 2003 12:58:58 +0000 (05:58 -0700)
There is a bug in cpufreq call back funtion in timer_tsc routines,
that can result in system deadlock. The issue is: grabbing the
write_lock on xtime_lock without disabling the interrupts. So,=20
if we happen to get a timer interrupt while we are in this code,
system will go into a deadlock.

This bug only effects the kernels that have CONFIG_CPU_FREQ enabled.

arch/i386/kernel/timers/timer_tsc.c

index f8b3c918a955b00fd06db57abecf026c67942018..e87ec7a48edf231b1a1e7e68843450115b81727c 100644 (file)
@@ -321,7 +321,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
 {
        struct cpufreq_freqs *freq = data;
 
-       write_seqlock(&xtime_lock);
+       write_seqlock_irq(&xtime_lock);
        if (!ref_freq) {
                ref_freq = freq->old;
                loops_per_jiffy_ref = cpu_data[freq->cpu].loops_per_jiffy;
@@ -342,7 +342,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
                }
 #endif
        }
-       write_sequnlock(&xtime_lock);
+       write_sequnlock_irq(&xtime_lock);
 
        return 0;
 }