Messages in this thread Patch in this message | | | Subject | [PATCH][BUGFIX] Bug in timer_tsc cpufreq callback | Date | Sat, 11 Oct 2003 12:22:06 -0700 | From | "Pallipadi, Venkatesh" <> |
| |
Hi,
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, 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. Attached patch fixes it. Please apply.
Thanks, -Venkatesh
--- linux-2.6.0-test6/arch/i386/kernel/timers/timer_tsc.c.org 2003-10-10 14:01:02.000000000 -0700 +++ linux-2.6.0-test6/arch/i386/kernel/timers/timer_tsc.c 2003-10-10 14:01:24.000000000 -0700 @@ -321,7 +321,7 @@ time_cpufreq_notifier(struct notifier_bl { 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_bl } #endif } - write_sequnlock(&xtime_lock); + write_sequnlock_irq(&xtime_lock); return 0; }[unhandled content-type:application/octet-stream]
| |