aboutsummaryrefslogtreecommitdiff
path: root/localversion-rt
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2012-08-03 00:16:45 -0400
committerSteven Rostedt <rostedt@goodmis.org>2012-08-03 00:16:45 -0400
commit660436ca79a9749f3cc66984dae066ced57c9d84 (patch)
treedc51b638651aaa67d172ac334c1bf06ac1ea855e /localversion-rt
parent0a085d25fb3ae4f738a50c1e089be936e56e2a3a (diff)
parentf351a1d7efda2edd52c23a150b07b8380c47b6c0 (diff)
Merge tag 'v3.0.39' into v3.0-rt
This is the 3.0.39 stable release Conflicts: kernel/hrtimer.c kernel/time/ntp.c kernel/time/timekeeping.c Required fixup: diff --cc kernel/hrtimer.c index 363965f,957869f..0000000 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@@ -1597,17 -1407,24 +1611,24 @@@ void hrtimer_peek_ahead_timers(void local_irq_restore(flags); } +#else /* CONFIG_HIGH_RES_TIMERS */ + +static inline void __hrtimer_peek_ahead_timers(void) { } + +#endif /* !CONFIG_HIGH_RES_TIMERS */ + static void run_hrtimer_softirq(struct softirq_action *h) { + struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases); + + if (cpu_base->clock_was_set) { + cpu_base->clock_was_set = 0; + clock_was_set(); + } + - hrtimer_peek_ahead_timers(); + hrtimer_rt_run_pending(); } -#else /* CONFIG_HIGH_RES_TIMERS */ - -static inline void __hrtimer_peek_ahead_timers(void) { } - -#endif /* !CONFIG_HIGH_RES_TIMERS */ - /* * Called from timer softirq every jiffy, expire hrtimers: * diff --cc kernel/time/ntp.c index 419cbaa,61fc450..0000000 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c @@@ -389,24 -406,7 +406,6 @@@ int second_overflow(unsigned long secs break; } - write_seqcount_end(&xtime_seq); - raw_spin_unlock(&xtime_lock); -- - return res; - } - - /* - * this routine handles the overflow of the microsecond field - * - * The tricky bits of code to handle the accurate clock support - * were provided by Dave Mills (Mills@UDEL.EDU) of NTP fame. - * They were originally developed for SUN and DEC kernels. - * All the kudos should go to Dave for this stuff. - */ - void second_overflow(void) - { - s64 delta; - /* Bump the maxerror field */ time_maxerror += MAXFREQ / NSEC_PER_USEC; if (time_maxerror > NTP_PHASE_LIMIT) { diff --cc kernel/time/timekeeping.c index 6ac6438,678ae31..0000000 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@@ -376,14 -395,9 +396,10 @@@ int do_settimeofday(const struct timesp xtime = *tv; - timekeeper.ntp_error = 0; - ntp_clear(); - - update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, - timekeeper.mult); + timekeeping_update(true); - write_sequnlock_irqrestore(&xtime_lock, flags); + write_seqcount_end(&xtime_seq); + raw_spin_unlock_irqrestore(&xtime_lock, flags); /* signal hrtimers about time change */ clock_was_set(); @@@ -415,14 -428,9 +431,10 @@@ int timekeeping_inject_offset(struct ti xtime = timespec_add(xtime, *ts); wall_to_monotonic = timespec_sub(wall_to_monotonic, *ts); - timekeeper.ntp_error = 0; - ntp_clear(); - - update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, - timekeeper.mult); + timekeeping_update(true); - write_sequnlock_irqrestore(&xtime_lock, flags); + write_seqcount_end(&xtime_seq); + raw_spin_unlock_irqrestore(&xtime_lock, flags); /* signal hrtimers about time change */ clock_was_set(); @@@ -596,10 -603,10 +608,11 @@@ void __init timekeeping_init(void } set_normalized_timespec(&wall_to_monotonic, -boot.tv_sec, -boot.tv_nsec); + update_rt_offset(); total_sleep_time.tv_sec = 0; total_sleep_time.tv_nsec = 0; - write_sequnlock_irqrestore(&xtime_lock, flags); + write_seqcount_end(&xtime_seq); + raw_spin_unlock_irqrestore(&xtime_lock, flags); } /* time in seconds when suspend began */ @@@ -646,13 -658,9 +665,10 @@@ void timekeeping_inject_sleeptime(struc __timekeeping_inject_sleeptime(delta); - timekeeper.ntp_error = 0; - ntp_clear(); - update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, - timekeeper.mult); + timekeeping_update(true); - write_sequnlock_irqrestore(&xtime_lock, flags); + write_seqcount_end(&xtime_seq); + raw_spin_unlock_irqrestore(&xtime_lock, flags); /* signal hrtimers about time change */ clock_was_set(); @@@ -686,8 -693,8 +702,9 @@@ static void timekeeping_resume(void timekeeper.clock->cycle_last = timekeeper.clock->read(timekeeper.clock); timekeeper.ntp_error = 0; timekeeping_suspended = 0; + timekeeping_update(false); - write_sequnlock_irqrestore(&xtime_lock, flags); + write_seqcount_end(&xtime_seq); + raw_spin_unlock_irqrestore(&xtime_lock, flags); touch_softlockup_watchdog(); @@@ -1111,9 -1124,43 +1136,43 @@@ void get_xtime_and_monotonic_and_sleep_ *xtim = xtime; *wtom = wall_to_monotonic; *sleep = total_sleep_time; - } while (read_seqretry(&xtime_lock, seq)); + } while (read_seqcount_retry(&xtime_seq, seq)); } + #ifdef CONFIG_HIGH_RES_TIMERS + /** + * ktime_get_update_offsets - hrtimer helper + * @real: pointer to storage for monotonic -> realtime offset + * @_boot: pointer to storage for monotonic -> boottime offset + * + * Returns current monotonic time and updates the offsets + * Called from hrtimer_interupt() or retrigger_next_event() + */ + ktime_t ktime_get_update_offsets(ktime_t *real, ktime_t *boot) + { + ktime_t now; + unsigned int seq; + u64 secs, nsecs; + + do { - seq = read_seqbegin(&xtime_lock); ++ seq = read_seqcount_begin(&xtime_seq); + + secs = xtime.tv_sec; + nsecs = xtime.tv_nsec; + nsecs += timekeeping_get_ns(); + /* If arch requires, add in gettimeoffset() */ + nsecs += arch_gettimeoffset(); + + *real = offs_real; + *boot = offs_boot; - } while (read_seqretry(&xtime_lock, seq)); ++ } while (read_seqcount_retry(&xtime_seq, seq)); + + now = ktime_add_ns(ktime_set(secs, 0), nsecs); + now = ktime_sub(now, *real); + return now; + } + #endif + /** * ktime_get_monotonic_offset() - get wall_to_monotonic in ktime_t format */ Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'localversion-rt')
0 files changed, 0 insertions, 0 deletions