timer TSC check suspend notifier change
PATCH 1/1 timer TSC check suspend notifier change
in suspend time, the TSC CPUFREQ_SUSPENDCHANGE notifier change might wrongly enable interrupt. cpufreq driver suspend/resume is in interrupt disabled environment.
---
linux-2.6.17-rc3-root/arch/i386/kernel/timers/timer_tsc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
arch/i386/kernel/timers/timer_tsc.c renamed from arch/i386/kernel/timers/timer_tsc.c~timer_tsc_check_suspend_change +2 -2
@@ -279,7 +279,7 @@ time_cpufreq_notifier(struct notifier_bl {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_bl } end: -if (val !=CPUFREQ_RESUMECHANGE ) +if (val !=CPUFREQ_RESUMECHANGE && val !=CPUFREQ_SUSPENDCHANGE )write_sequnlock_irq (&xtime_lock);return 0 ;
_
Quoted 13 lines · Shaohua Li
in suspend time, the TSC
CPUFREQ_SUSPENDCHANGEnotifier change might wrongly enable interrupt. cpufreq driver suspend/resume is in interrupt disabled environment.Signed-off-by Shaohua Li <[email protected]>---
linux-2.6.17-rc3-root/arch/i386/kernel/timers/timer_tsc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)diff -puN
arch/i386/kernel/timers/timer_tsc.c~timer_tsc_check_suspend_changearch/i386/kernel/timers/timer_tsc.c
arch/i386/kernel/timers/timer_tsc.c time_cpufreq_notifier(struct notifier_bl · line 283
Quoted 6 lines
arch/i386/kernel/timers/timer_tsc.c renamed from arch/i386/kernel/timers/timer_tsc.c~timer_tsc_check_suspend_change +1
-1@@ -279,7 +279,7 @@ time_cpufreq_notifier(struct notifier_bl {struct cpufreq_freqs *freq = data; -if (val !=CPUFREQ_RESUMECHANGE ) +if (val !=CPUFREQ_RESUMECHANGE && val !=CPUFREQ_SUSPENDCHANGE )write_seqlock_irq (&xtime_lock);
Better would be to change it to write_seqlock_irqsave() (if that exists, if not add it)
arch/i386/kernel/timers/timer_tsc.c time_cpufreq_notifier(struct notifier_bl · line 316
Quoted 9 lines
arch/i386/kernel/timers/timer_tsc.c renamed from arch/i386/kernel/timers/timer_tsc.c~timer_tsc_check_suspend_change +1
-1if (!ref_freq) {if (!freq->old){@@ -312,7 +312,7 @@ time_cpufreq_notifier(struct notifier_bl } end: -if (val !=CPUFREQ_RESUMECHANGE ) +if (val !=CPUFREQ_RESUMECHANGE && val !=CPUFREQ_SUSPENDCHANGE )write_sequnlock_irq (&xtime_lock);
and _restore
-Andi