summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
cef9037)
In moving the NTP state to be protected by the timekeeping locks,
be sure to acquire the timekeeping locks prior to calling
ntp functions.
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
raw_spin_lock_irqsave(&timekeeper_lock, flags);
write_seqcount_begin(&timekeeper_seq);
raw_spin_lock_irqsave(&timekeeper_lock, flags);
write_seqcount_begin(&timekeeper_seq);
clock = clocksource_default_clock();
if (clock->enable)
clock->enable(clock);
clock = clocksource_default_clock();
if (clock->enable)
clock->enable(clock);
*/
int do_adjtimex(struct timex *txc)
{
*/
int do_adjtimex(struct timex *txc)
{
struct timespec ts;
s32 tai, orig_tai;
int ret;
struct timespec ts;
s32 tai, orig_tai;
int ret;
getnstimeofday(&ts);
orig_tai = tai = timekeeping_get_tai_offset();
getnstimeofday(&ts);
orig_tai = tai = timekeeping_get_tai_offset();
+ raw_spin_lock_irqsave(&timekeeper_lock, flags);
+ write_seqcount_begin(&timekeeper_seq);
+
ret = __do_adjtimex(txc, &ts, &tai);
ret = __do_adjtimex(txc, &ts, &tai);
+ write_seqcount_end(&timekeeper_seq);
+ raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
+
if (tai != orig_tai)
timekeeping_set_tai_offset(tai);
if (tai != orig_tai)
timekeeping_set_tai_offset(tai);
*/
void hardpps(const struct timespec *phase_ts, const struct timespec *raw_ts)
{
*/
void hardpps(const struct timespec *phase_ts, const struct timespec *raw_ts)
{
+ unsigned long flags;
+
+ raw_spin_lock_irqsave(&timekeeper_lock, flags);
+ write_seqcount_begin(&timekeeper_seq);
+
__hardpps(phase_ts, raw_ts);
__hardpps(phase_ts, raw_ts);
+
+ write_seqcount_end(&timekeeper_seq);
+ raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
}
EXPORT_SYMBOL(hardpps);
#endif
}
EXPORT_SYMBOL(hardpps);
#endif