Commit e6c34387 authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[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: default avatarDominik Brodowski <linux@brodo.de>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 81cc0c42
......@@ -265,6 +265,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
{
struct cpufreq_freqs *freq = data;
if (val != CPUFREQ_RESUMECHANGE)
write_seqlock_irq(&xtime_lock);
if (!ref_freq) {
ref_freq = freq->old;
......@@ -291,6 +292,8 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
}
#endif
}
if (val != CPUFREQ_RESUMECHANGE)
write_sequnlock_irq(&xtime_lock);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment