History

Merge tag 'fortglx-3.20-time' of https://git.linaro.org/people/john.stultz/linux into timers/core

Pull time updates from John Stultz for 3.20: * ktime division optimization * Expose a few more y2038-safe timekeeping interfaces * RTC core changes to address y2038

Thomas Gleixner committed 11 years ago

Commit fe31fca2 parents 9bc7491 9a4a44510 files · +63 −46Browse files

Showing the changes to kernel/time (3 of 10 files). Show all

Unified · Split

3 files
  1. kernel/time/hrtimer.c +2 −2
  2. kernel/time/ntp.c +2 −2
  3. kernel/time/timekeeping.c +6 −6
kernel/time/hrtimer.c+2−2
@@ -266,7 +266,7 @@ lock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags) · 265 unmodified lines
266/*266/*
267 * Divide a ktime value by a nanosecond value267 * Divide a ktime value by a nanosecond value
268 */268 */
269u64 ktime_divns(const ktime_t kt, s64 div)269u64 __ktime_divns(const ktime_t kt, s64 div)
270{270{
271 u64 dclc;271 u64 dclc;
272 int sft = 0;272 int sft = 0;
@@ -282,7 +282,7 @@ u64 ktime_divns(const ktime_t kt, s64 div) · 9 unmodified lines
282 282
283 return dclc;283 return dclc;
284}284}
285EXPORT_SYMBOL_GPL(ktime_divns);285EXPORT_SYMBOL_GPL(__ktime_divns);
286#endif /* BITS_PER_LONG >= 64 */286#endif /* BITS_PER_LONG >= 64 */
287 287
288/*288/*
kernel/time/ntp.c+2−2
@@ -488,13 +488,13 @@ static void sync_cmos_clock(struct work_struct *work) · 487 unmodified lines
488 488
489 getnstimeofday64(&now);489 getnstimeofday64(&now);
490 if (abs(now.tv_nsec - (NSEC_PER_SEC / 2)) <= tick_nsec * 5) {490 if (abs(now.tv_nsec - (NSEC_PER_SEC / 2)) <= tick_nsec * 5) {
491 struct timespec adjust = timespec64_to_timespec(now);491 struct timespec64 adjust = now;
492 492
493 fail = -ENODEV;493 fail = -ENODEV;
494 if (persistent_clock_is_local)494 if (persistent_clock_is_local)
495 adjust.tv_sec -= (sys_tz.tz_minuteswest * 60);495 adjust.tv_sec -= (sys_tz.tz_minuteswest * 60);
496#ifdef CONFIG_GENERIC_CMOS_UPDATE496#ifdef CONFIG_GENERIC_CMOS_UPDATE
497 fail = update_persistent_clock(adjust);497 fail = update_persistent_clock(timespec64_to_timespec(adjust));
498#endif498#endif
499#ifdef CONFIG_RTC_SYSTOHC499#ifdef CONFIG_RTC_SYSTOHC
500 if (fail == -ENODEV)500 if (fail == -ENODEV)
kernel/time/timekeeping.c+6−6
@@ -1659,24 +1659,24 @@ out: · 1658 unmodified lines
1659}1659}
1660 1660
1661/**1661/**
1662 * getboottime - Return the real time of system boot.1662 * getboottime64 - Return the real time of system boot.
1663 * @ts: pointer to the timespec to be set1663 * @ts: pointer to the timespec64 to be set
1664 *1664 *
1665 * Returns the wall-time of boot in a timespec.1665 * Returns the wall-time of boot in a timespec64.
1666 *1666 *
1667 * This is based on the wall_to_monotonic offset and the total suspend1667 * This is based on the wall_to_monotonic offset and the total suspend
1668 * time. Calls to settimeofday will affect the value returned (which1668 * time. Calls to settimeofday will affect the value returned (which
1669 * basically means that however wrong your real time clock is at boot time,1669 * basically means that however wrong your real time clock is at boot time,
1670 * you get the right time here).1670 * you get the right time here).
1671 */1671 */
1672void getboottime(struct timespec *ts)1672void getboottime64(struct timespec64 *ts)
1673{1673{
1674 struct timekeeper *tk = &tk_core.timekeeper;1674 struct timekeeper *tk = &tk_core.timekeeper;
1675 ktime_t t = ktime_sub(tk->offs_real, tk->offs_boot);1675 ktime_t t = ktime_sub(tk->offs_real, tk->offs_boot);
1676 1676
1677 *ts = ktime_to_timespec(t);1677 *ts = ktime_to_timespec64(t);
1678}1678}
1679EXPORT_SYMBOL_GPL(getboottime);1679EXPORT_SYMBOL_GPL(getboottime64);
1680 1680
1681unsigned long get_seconds(void)1681unsigned long get_seconds(void)
1682{1682{