Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 366190
b: refs/heads/master
c: 06c017f
h: refs/heads/master
v: v3
  • Loading branch information
John Stultz committed Apr 4, 2013
1 parent 507d60d commit c947323
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cef90377fab488bd1f959efda178fb83250cf61d
refs/heads/master: 06c017fdd4dc48451a29ac37fc1db4a3f86b7f40
19 changes: 17 additions & 2 deletions trunk/kernel/time/timekeeping.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,10 +787,10 @@ void __init timekeeping_init(void)
boot.tv_nsec = 0;
}

ntp_init();

raw_spin_lock_irqsave(&timekeeper_lock, flags);
write_seqcount_begin(&timekeeper_seq);
ntp_init();

clock = clocksource_default_clock();
if (clock->enable)
clock->enable(clock);
Expand Down Expand Up @@ -1618,6 +1618,7 @@ EXPORT_SYMBOL_GPL(ktime_get_monotonic_offset);
*/
int do_adjtimex(struct timex *txc)
{
unsigned long flags;
struct timespec ts;
s32 tai, orig_tai;
int ret;
Expand All @@ -1641,8 +1642,14 @@ int do_adjtimex(struct timex *txc)
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);

write_seqcount_end(&timekeeper_seq);
raw_spin_unlock_irqrestore(&timekeeper_lock, flags);

if (tai != orig_tai)
timekeeping_set_tai_offset(tai);

Expand All @@ -1655,7 +1662,15 @@ int do_adjtimex(struct timex *txc)
*/
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);

write_seqcount_end(&timekeeper_seq);
raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
}
EXPORT_SYMBOL(hardpps);
#endif
Expand Down

0 comments on commit c947323

Please sign in to comment.