Commit a85829fd authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] add write_seqlock to cpufreq change notifier for TSC

From: Stephen Hemminger <shemminger@osdl.org>

The CPU frequency change detection code can change the values used to compute
time of day with TSC; but there was no locking around it.
parent d8e0b647
...@@ -213,6 +213,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, ...@@ -213,6 +213,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
{ {
struct cpufreq_freqs *freq = data; struct cpufreq_freqs *freq = data;
write_seqlock(&xtime_lock);
if (!ref_freq) { if (!ref_freq) {
ref_freq = freq->old; ref_freq = freq->old;
loops_per_jiffy_ref = cpu_data[freq->cpu].loops_per_jiffy; loops_per_jiffy_ref = cpu_data[freq->cpu].loops_per_jiffy;
...@@ -232,6 +233,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, ...@@ -232,6 +233,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
} }
#endif #endif
} }
write_sequnlock(&xtime_lock);
return 0; 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