Message ID | 1304478708-1273-1-git-send-email-john.stultz@linaro.org |
---|---|
State | Accepted |
Headers | show |
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 8ad5d57..89c7582 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -975,7 +975,15 @@ EXPORT_SYMBOL_GPL(monotonic_to_bootbased); unsigned long get_seconds(void) { - return xtime.tv_sec; + unsigned long seq, now; + + do { + seq = read_seqbegin(&xtime_lock); + + now = xtime.tv_sec; + } while (read_seqretry(&xtime_lock, seq)); + + return now; } EXPORT_SYMBOL(get_seconds);