Commit ad28d94a authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Linus Torvalds

[PATCH] hrtimer: fix up unlocked access to wall_to_monotonic

commit f4304ab2 (HZ free NTP) moved the
access to wall_to_monotonic in hrtimer_get_softirq_time() out of the
xtime_lock protection.

Move it back into the seq_lock section.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarJohn Stultz <johnstul@us.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c6ca97d2
...@@ -135,7 +135,7 @@ EXPORT_SYMBOL_GPL(ktime_get_ts); ...@@ -135,7 +135,7 @@ EXPORT_SYMBOL_GPL(ktime_get_ts);
static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base) static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base)
{ {
ktime_t xtim, tomono; ktime_t xtim, tomono;
struct timespec xts; struct timespec xts, tom;
unsigned long seq; unsigned long seq;
do { do {
...@@ -145,10 +145,11 @@ static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base) ...@@ -145,10 +145,11 @@ static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base)
#else #else
xts = xtime; xts = xtime;
#endif #endif
tom = wall_to_monotonic;
} while (read_seqretry(&xtime_lock, seq)); } while (read_seqretry(&xtime_lock, seq));
xtim = timespec_to_ktime(xts); xtim = timespec_to_ktime(xts);
tomono = timespec_to_ktime(wall_to_monotonic); tomono = timespec_to_ktime(tom);
base->clock_base[CLOCK_REALTIME].softirq_time = xtim; base->clock_base[CLOCK_REALTIME].softirq_time = xtim;
base->clock_base[CLOCK_MONOTONIC].softirq_time = base->clock_base[CLOCK_MONOTONIC].softirq_time =
ktime_add(xtim, tomono); ktime_add(xtim, tomono);
......
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