diff options
author | Dave Jones <davej@redhat.com> | 2004-08-11 13:31:55 +0100 |
---|---|---|
committer | Dave Jones <davej@delerium.codemonkey.org.uk> | 2004-08-11 13:31:55 +0100 |
commit | e6c343874d2bc351d6de9eb40f704d7eef007999 (patch) | |
tree | 7c2325dcd17e528603a430d24795bd2be0165192 /arch | |
parent | 81cc0c4263b868327936366d7c5f8deaf29aaf6e (diff) | |
download | history-e6c343874d2bc351d6de9eb40f704d7eef007999.tar.gz |
[CPUFREQ] avoid re-enabling of interrupts too early during resume
Avoid re-enabling the interrupts in "write_sequnlock_irq" in
cpufreq_timer_notifier() when it gets called in "CPUFREQ_RESUMECHANGE" state
-- that happens if the CPU frequency is detected to be different now from
what it was during suspension, and that's a resume call of a sys device, so
with interrupts off.
Without this patch, it can cause nasty oopses. IIRC resume is done on one
CPU only, so we don't need no lock anyways. Right?
Many thanks to Brian J. Murrell for debugging this issue.
Signed-off-by: Dominik Brodowski <linux@brodo.de>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/timers/timer_tsc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c index a1e3f6f966987a..34e9b8eba1d2d9 100644 --- a/arch/i386/kernel/timers/timer_tsc.c +++ b/arch/i386/kernel/timers/timer_tsc.c @@ -265,7 +265,8 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, { struct cpufreq_freqs *freq = data; - write_seqlock_irq(&xtime_lock); + if (val != CPUFREQ_RESUMECHANGE) + write_seqlock_irq(&xtime_lock); if (!ref_freq) { ref_freq = freq->old; loops_per_jiffy_ref = cpu_data[freq->cpu].loops_per_jiffy; @@ -291,7 +292,9 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, } #endif } - write_sequnlock_irq(&xtime_lock); + + if (val != CPUFREQ_RESUMECHANGE) + write_sequnlock_irq(&xtime_lock); return 0; } |