From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: John Stultz <john.stultz@linaro.org>,
Peter Zijlstra <peterz@infradead.org>
Subject: [patch 09/55] timekeeping: Convert timekeeping core to use timespec64s
Date: Fri, 11 Jul 2014 13:44:11 -0000 [thread overview]
Message-ID: <20140711133705.978234950@linutronix.de> (raw)
In-Reply-To: 20140711133623.530368377@linutronix.de
[-- Attachment #1: jstultz-tk-480e2d6.patch --]
[-- Type: text/plain, Size: 21065 bytes --]
From: John Stultz <john.stultz@linaro.org>
Convert the core timekeeping logic to use timespec64s. This moves the
2038 issues out of the core logic and into all of the accessor
functions.
Future changes will need to push the timespec64s out to all
timekeeping users, but that can be done interface by interface.
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
include/linux/timekeeper_internal.h | 10 +-
kernel/time/ntp.c | 8 -
kernel/time/ntp_internal.h | 2
kernel/time/timekeeping.c | 172 ++++++++++++++++++++----------------
kernel/time/timekeeping_debug.c | 2
kernel/time/timekeeping_internal.h | 2
6 files changed, 109 insertions(+), 87 deletions(-)
Index: tip/include/linux/timekeeper_internal.h
===================================================================
--- tip.orig/include/linux/timekeeper_internal.h
+++ tip/include/linux/timekeeper_internal.h
@@ -55,15 +55,15 @@ struct timekeeper {
* - wall_to_monotonic is no longer the boot time, getboottime must be
* used instead.
*/
- struct timespec wall_to_monotonic;
+ struct timespec64 wall_to_monotonic;
/* Offset clock monotonic -> clock realtime */
ktime_t offs_real;
/* time spent in suspend */
- struct timespec total_sleep_time;
+ struct timespec64 total_sleep_time;
/* Offset clock monotonic -> clock boottime */
ktime_t offs_boot;
/* The raw monotonic time for the CLOCK_MONOTONIC_RAW posix clock. */
- struct timespec raw_time;
+ struct timespec64 raw_time;
/* The current UTC to TAI offset in seconds */
s32 tai_offset;
/* Offset clock monotonic -> clock tai */
@@ -71,9 +71,9 @@ struct timekeeper {
};
-static inline struct timespec tk_xtime(struct timekeeper *tk)
+static inline struct timespec64 tk_xtime(struct timekeeper *tk)
{
- struct timespec ts;
+ struct timespec64 ts;
ts.tv_sec = tk->xtime_sec;
ts.tv_nsec = (long)(tk->xtime_nsec >> tk->shift);
Index: tip/kernel/time/ntp.c
===================================================================
--- tip.orig/kernel/time/ntp.c
+++ tip/kernel/time/ntp.c
@@ -531,7 +531,7 @@ void ntp_notify_cmos_timer(void) { }
/*
* Propagate a new txc->status value into the NTP state:
*/
-static inline void process_adj_status(struct timex *txc, struct timespec *ts)
+static inline void process_adj_status(struct timex *txc, struct timespec64 *ts)
{
if ((time_status & STA_PLL) && !(txc->status & STA_PLL)) {
time_state = TIME_OK;
@@ -554,7 +554,7 @@ static inline void process_adj_status(st
static inline void process_adjtimex_modes(struct timex *txc,
- struct timespec *ts,
+ struct timespec64 *ts,
s32 *time_tai)
{
if (txc->modes & ADJ_STATUS)
@@ -640,7 +640,7 @@ int ntp_validate_timex(struct timex *txc
* adjtimex mainly allows reading (and writing, if superuser) of
* kernel time-keeping variables. used by xntpd.
*/
-int __do_adjtimex(struct timex *txc, struct timespec *ts, s32 *time_tai)
+int __do_adjtimex(struct timex *txc, struct timespec64 *ts, s32 *time_tai)
{
int result;
@@ -684,7 +684,7 @@ int __do_adjtimex(struct timex *txc, str
/* fill PPS status fields */
pps_fill_timex(txc);
- txc->time.tv_sec = ts->tv_sec;
+ txc->time.tv_sec = (time_t)ts->tv_sec;
txc->time.tv_usec = ts->tv_nsec;
if (!(time_status & STA_NANO))
txc->time.tv_usec /= NSEC_PER_USEC;
Index: tip/kernel/time/ntp_internal.h
===================================================================
--- tip.orig/kernel/time/ntp_internal.h
+++ tip/kernel/time/ntp_internal.h
@@ -7,6 +7,6 @@ extern void ntp_clear(void);
extern u64 ntp_tick_length(void);
extern int second_overflow(unsigned long secs);
extern int ntp_validate_timex(struct timex *);
-extern int __do_adjtimex(struct timex *, struct timespec *, s32 *);
+extern int __do_adjtimex(struct timex *, struct timespec64 *, s32 *);
extern void __hardpps(const struct timespec *, const struct timespec *);
#endif /* _LINUX_NTP_INTERNAL_H */
Index: tip/kernel/time/timekeeping.c
===================================================================
--- tip.orig/kernel/time/timekeeping.c
+++ tip/kernel/time/timekeeping.c
@@ -51,43 +51,43 @@ static inline void tk_normalize_xtime(st
}
}
-static void tk_set_xtime(struct timekeeper *tk, const struct timespec *ts)
+static void tk_set_xtime(struct timekeeper *tk, const struct timespec64 *ts)
{
tk->xtime_sec = ts->tv_sec;
tk->xtime_nsec = (u64)ts->tv_nsec << tk->shift;
}
-static void tk_xtime_add(struct timekeeper *tk, const struct timespec *ts)
+static void tk_xtime_add(struct timekeeper *tk, const struct timespec64 *ts)
{
tk->xtime_sec += ts->tv_sec;
tk->xtime_nsec += (u64)ts->tv_nsec << tk->shift;
tk_normalize_xtime(tk);
}
-static void tk_set_wall_to_mono(struct timekeeper *tk, struct timespec wtm)
+static void tk_set_wall_to_mono(struct timekeeper *tk, struct timespec64 wtm)
{
- struct timespec tmp;
+ struct timespec64 tmp;
/*
* Verify consistency of: offset_real = -wall_to_monotonic
* before modifying anything
*/
- set_normalized_timespec(&tmp, -tk->wall_to_monotonic.tv_sec,
+ set_normalized_timespec64(&tmp, -tk->wall_to_monotonic.tv_sec,
-tk->wall_to_monotonic.tv_nsec);
- WARN_ON_ONCE(tk->offs_real.tv64 != timespec_to_ktime(tmp).tv64);
+ WARN_ON_ONCE(tk->offs_real.tv64 != timespec64_to_ktime(tmp).tv64);
tk->wall_to_monotonic = wtm;
- set_normalized_timespec(&tmp, -wtm.tv_sec, -wtm.tv_nsec);
- tk->offs_real = timespec_to_ktime(tmp);
+ set_normalized_timespec64(&tmp, -wtm.tv_sec, -wtm.tv_nsec);
+ tk->offs_real = timespec64_to_ktime(tmp);
tk->offs_tai = ktime_add(tk->offs_real, ktime_set(tk->tai_offset, 0));
}
-static void tk_set_sleep_time(struct timekeeper *tk, struct timespec t)
+static void tk_set_sleep_time(struct timekeeper *tk, struct timespec64 t)
{
/* Verify consistency before modifying */
- WARN_ON_ONCE(tk->offs_boot.tv64 != timespec_to_ktime(tk->total_sleep_time).tv64);
+ WARN_ON_ONCE(tk->offs_boot.tv64 != timespec64_to_ktime(tk->total_sleep_time).tv64);
tk->total_sleep_time = t;
- tk->offs_boot = timespec_to_ktime(t);
+ tk->offs_boot = timespec64_to_ktime(t);
}
/**
@@ -281,7 +281,7 @@ static void timekeeping_forward_now(stru
tk_normalize_xtime(tk);
nsec = clocksource_cyc2ns(cycle_delta, clock->mult, clock->shift);
- timespec_add_ns(&tk->raw_time, nsec);
+ timespec64_add_ns(&tk->raw_time, nsec);
}
/**
@@ -360,7 +360,7 @@ EXPORT_SYMBOL_GPL(ktime_get);
void ktime_get_ts(struct timespec *ts)
{
struct timekeeper *tk = &timekeeper;
- struct timespec tomono;
+ struct timespec64 ts64, tomono;
s64 nsec;
unsigned int seq;
@@ -368,15 +368,16 @@ void ktime_get_ts(struct timespec *ts)
do {
seq = read_seqcount_begin(&timekeeper_seq);
- ts->tv_sec = tk->xtime_sec;
+ ts64.tv_sec = tk->xtime_sec;
nsec = timekeeping_get_ns(tk);
tomono = tk->wall_to_monotonic;
} while (read_seqcount_retry(&timekeeper_seq, seq));
- ts->tv_sec += tomono.tv_sec;
- ts->tv_nsec = 0;
- timespec_add_ns(ts, nsec + tomono.tv_nsec);
+ ts64.tv_sec += tomono.tv_sec;
+ ts64.tv_nsec = 0;
+ timespec64_add_ns(&ts64, nsec + tomono.tv_nsec);
+ *ts = timespec64_to_timespec(ts64);
}
EXPORT_SYMBOL_GPL(ktime_get_ts);
@@ -390,6 +391,7 @@ EXPORT_SYMBOL_GPL(ktime_get_ts);
void timekeeping_clocktai(struct timespec *ts)
{
struct timekeeper *tk = &timekeeper;
+ struct timespec64 ts64;
unsigned long seq;
u64 nsecs;
@@ -398,13 +400,14 @@ void timekeeping_clocktai(struct timespe
do {
seq = read_seqcount_begin(&timekeeper_seq);
- ts->tv_sec = tk->xtime_sec + tk->tai_offset;
+ ts64.tv_sec = tk->xtime_sec + tk->tai_offset;
nsecs = timekeeping_get_ns(tk);
} while (read_seqcount_retry(&timekeeper_seq, seq));
- ts->tv_nsec = 0;
- timespec_add_ns(ts, nsecs);
+ ts64.tv_nsec = 0;
+ timespec64_add_ns(&ts64, nsecs);
+ *ts = timespec64_to_timespec(ts64);
}
EXPORT_SYMBOL(timekeeping_clocktai);
@@ -446,7 +449,7 @@ void getnstime_raw_and_real(struct times
do {
seq = read_seqcount_begin(&timekeeper_seq);
- *ts_raw = tk->raw_time;
+ *ts_raw = timespec64_to_timespec(tk->raw_time);
ts_real->tv_sec = tk->xtime_sec;
ts_real->tv_nsec = 0;
@@ -487,7 +490,7 @@ EXPORT_SYMBOL(do_gettimeofday);
int do_settimeofday(const struct timespec *tv)
{
struct timekeeper *tk = &timekeeper;
- struct timespec ts_delta, xt;
+ struct timespec64 ts_delta, xt, tmp;
unsigned long flags;
if (!timespec_valid_strict(tv))
@@ -502,9 +505,10 @@ int do_settimeofday(const struct timespe
ts_delta.tv_sec = tv->tv_sec - xt.tv_sec;
ts_delta.tv_nsec = tv->tv_nsec - xt.tv_nsec;
- tk_set_wall_to_mono(tk, timespec_sub(tk->wall_to_monotonic, ts_delta));
+ tk_set_wall_to_mono(tk, timespec64_sub(tk->wall_to_monotonic, ts_delta));
- tk_set_xtime(tk, tv);
+ tmp = timespec_to_timespec64(*tv);
+ tk_set_xtime(tk, &tmp);
timekeeping_update(tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_SET);
@@ -528,26 +532,28 @@ int timekeeping_inject_offset(struct tim
{
struct timekeeper *tk = &timekeeper;
unsigned long flags;
- struct timespec tmp;
+ struct timespec64 ts64, tmp;
int ret = 0;
if ((unsigned long)ts->tv_nsec >= NSEC_PER_SEC)
return -EINVAL;
+ ts64 = timespec_to_timespec64(*ts);
+
raw_spin_lock_irqsave(&timekeeper_lock, flags);
write_seqcount_begin(&timekeeper_seq);
timekeeping_forward_now(tk);
/* Make sure the proposed value is valid */
- tmp = timespec_add(tk_xtime(tk), *ts);
- if (!timespec_valid_strict(&tmp)) {
+ tmp = timespec64_add(tk_xtime(tk), ts64);
+ if (!timespec64_valid_strict(&tmp)) {
ret = -EINVAL;
goto error;
}
- tk_xtime_add(tk, ts);
- tk_set_wall_to_mono(tk, timespec_sub(tk->wall_to_monotonic, *ts));
+ tk_xtime_add(tk, &ts64);
+ tk_set_wall_to_mono(tk, timespec64_sub(tk->wall_to_monotonic, ts64));
error: /* even if we error out, we forwarded the time, so call update */
timekeeping_update(tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_SET);
@@ -691,17 +697,19 @@ EXPORT_SYMBOL_GPL(ktime_get_real);
void getrawmonotonic(struct timespec *ts)
{
struct timekeeper *tk = &timekeeper;
+ struct timespec64 ts64;
unsigned long seq;
s64 nsecs;
do {
seq = read_seqcount_begin(&timekeeper_seq);
nsecs = timekeeping_get_ns_raw(tk);
- *ts = tk->raw_time;
+ ts64 = tk->raw_time;
} while (read_seqcount_retry(&timekeeper_seq, seq));
- timespec_add_ns(ts, nsecs);
+ timespec64_add_ns(&ts64, nsecs);
+ *ts = timespec64_to_timespec(ts64);
}
EXPORT_SYMBOL(getrawmonotonic);
@@ -781,11 +789,12 @@ void __init timekeeping_init(void)
struct timekeeper *tk = &timekeeper;
struct clocksource *clock;
unsigned long flags;
- struct timespec now, boot, tmp;
-
- read_persistent_clock(&now);
+ struct timespec64 now, boot, tmp;
+ struct timespec ts;
- if (!timespec_valid_strict(&now)) {
+ read_persistent_clock(&ts);
+ now = timespec_to_timespec64(ts);
+ if (!timespec64_valid_strict(&now)) {
pr_warn("WARNING: Persistent clock returned invalid value!\n"
" Check your CMOS/BIOS settings.\n");
now.tv_sec = 0;
@@ -793,8 +802,9 @@ void __init timekeeping_init(void)
} else if (now.tv_sec || now.tv_nsec)
persistent_clock_exist = true;
- read_boot_clock(&boot);
- if (!timespec_valid_strict(&boot)) {
+ read_boot_clock(&ts);
+ boot = timespec_to_timespec64(ts);
+ if (!timespec64_valid_strict(&boot)) {
pr_warn("WARNING: Boot clock returned invalid value!\n"
" Check your CMOS/BIOS settings.\n");
boot.tv_sec = 0;
@@ -816,7 +826,7 @@ void __init timekeeping_init(void)
if (boot.tv_sec == 0 && boot.tv_nsec == 0)
boot = tk_xtime(tk);
- set_normalized_timespec(&tmp, -boot.tv_sec, -boot.tv_nsec);
+ set_normalized_timespec64(&tmp, -boot.tv_sec, -boot.tv_nsec);
tk_set_wall_to_mono(tk, tmp);
tmp.tv_sec = 0;
@@ -830,7 +840,7 @@ void __init timekeeping_init(void)
}
/* time in seconds when suspend began */
-static struct timespec timekeeping_suspend_time;
+static struct timespec64 timekeeping_suspend_time;
/**
* __timekeeping_inject_sleeptime - Internal function to add sleep interval
@@ -840,17 +850,17 @@ static struct timespec timekeeping_suspe
* adds the sleep offset to the timekeeping variables.
*/
static void __timekeeping_inject_sleeptime(struct timekeeper *tk,
- struct timespec *delta)
+ struct timespec64 *delta)
{
- if (!timespec_valid_strict(delta)) {
+ if (!timespec64_valid_strict(delta)) {
printk_deferred(KERN_WARNING
"__timekeeping_inject_sleeptime: Invalid "
"sleep delta value!\n");
return;
}
tk_xtime_add(tk, delta);
- tk_set_wall_to_mono(tk, timespec_sub(tk->wall_to_monotonic, *delta));
- tk_set_sleep_time(tk, timespec_add(tk->total_sleep_time, *delta));
+ tk_set_wall_to_mono(tk, timespec64_sub(tk->wall_to_monotonic, *delta));
+ tk_set_sleep_time(tk, timespec64_add(tk->total_sleep_time, *delta));
tk_debug_account_sleep_time(delta);
}
@@ -867,6 +877,7 @@ static void __timekeeping_inject_sleepti
void timekeeping_inject_sleeptime(struct timespec *delta)
{
struct timekeeper *tk = &timekeeper;
+ struct timespec64 tmp;
unsigned long flags;
/*
@@ -881,7 +892,8 @@ void timekeeping_inject_sleeptime(struct
timekeeping_forward_now(tk);
- __timekeeping_inject_sleeptime(tk, delta);
+ tmp = timespec_to_timespec64(*delta);
+ __timekeeping_inject_sleeptime(tk, &tmp);
timekeeping_update(tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_SET);
@@ -904,11 +916,13 @@ static void timekeeping_resume(void)
struct timekeeper *tk = &timekeeper;
struct clocksource *clock = tk->clock;
unsigned long flags;
- struct timespec ts_new, ts_delta;
+ struct timespec64 ts_new, ts_delta;
+ struct timespec tmp;
cycle_t cycle_now, cycle_delta;
bool suspendtime_found = false;
- read_persistent_clock(&ts_new);
+ read_persistent_clock(&tmp);
+ ts_new = timespec_to_timespec64(tmp);
clockevents_resume();
clocksource_resume();
@@ -951,10 +965,10 @@ static void timekeeping_resume(void)
}
nsec += ((u64) cycle_delta * mult) >> shift;
- ts_delta = ns_to_timespec(nsec);
+ ts_delta = ns_to_timespec64(nsec);
suspendtime_found = true;
- } else if (timespec_compare(&ts_new, &timekeeping_suspend_time) > 0) {
- ts_delta = timespec_sub(ts_new, timekeeping_suspend_time);
+ } else if (timespec64_compare(&ts_new, &timekeeping_suspend_time) > 0) {
+ ts_delta = timespec64_sub(ts_new, timekeeping_suspend_time);
suspendtime_found = true;
}
@@ -981,10 +995,12 @@ static int timekeeping_suspend(void)
{
struct timekeeper *tk = &timekeeper;
unsigned long flags;
- struct timespec delta, delta_delta;
- static struct timespec old_delta;
+ struct timespec64 delta, delta_delta;
+ static struct timespec64 old_delta;
+ struct timespec tmp;
- read_persistent_clock(&timekeeping_suspend_time);
+ read_persistent_clock(&tmp);
+ timekeeping_suspend_time = timespec_to_timespec64(tmp);
/*
* On some systems the persistent_clock can not be detected at
@@ -1005,8 +1021,8 @@ static int timekeeping_suspend(void)
* try to compensate so the difference in system time
* and persistent_clock time stays close to constant.
*/
- delta = timespec_sub(tk_xtime(tk), timekeeping_suspend_time);
- delta_delta = timespec_sub(delta, old_delta);
+ delta = timespec64_sub(tk_xtime(tk), timekeeping_suspend_time);
+ delta_delta = timespec64_sub(delta, old_delta);
if (abs(delta_delta.tv_sec) >= 2) {
/*
* if delta_delta is too large, assume time correction
@@ -1016,7 +1032,7 @@ static int timekeeping_suspend(void)
} else {
/* Otherwise try to adjust old_system to compensate */
timekeeping_suspend_time =
- timespec_add(timekeeping_suspend_time, delta_delta);
+ timespec64_add(timekeeping_suspend_time, delta_delta);
}
timekeeping_update(tk, TK_MIRROR);
@@ -1253,14 +1269,14 @@ static inline unsigned int accumulate_ns
/* Figure out if its a leap sec and apply if needed */
leap = second_overflow(tk->xtime_sec);
if (unlikely(leap)) {
- struct timespec ts;
+ struct timespec64 ts;
tk->xtime_sec += leap;
ts.tv_sec = leap;
ts.tv_nsec = 0;
tk_set_wall_to_mono(tk,
- timespec_sub(tk->wall_to_monotonic, ts));
+ timespec64_sub(tk->wall_to_monotonic, ts));
__timekeeping_set_tai_offset(tk, tk->tai_offset - leap);
@@ -1469,7 +1485,7 @@ EXPORT_SYMBOL_GPL(getboottime);
void get_monotonic_boottime(struct timespec *ts)
{
struct timekeeper *tk = &timekeeper;
- struct timespec tomono, sleep;
+ struct timespec64 tomono, sleep, ret;
s64 nsec;
unsigned int seq;
@@ -1477,16 +1493,17 @@ void get_monotonic_boottime(struct times
do {
seq = read_seqcount_begin(&timekeeper_seq);
- ts->tv_sec = tk->xtime_sec;
+ ret.tv_sec = tk->xtime_sec;
nsec = timekeeping_get_ns(tk);
tomono = tk->wall_to_monotonic;
sleep = tk->total_sleep_time;
} while (read_seqcount_retry(&timekeeper_seq, seq));
- ts->tv_sec += tomono.tv_sec + sleep.tv_sec;
- ts->tv_nsec = 0;
- timespec_add_ns(ts, nsec + tomono.tv_nsec + sleep.tv_nsec);
+ ret.tv_sec += tomono.tv_sec + sleep.tv_sec;
+ ret.tv_nsec = 0;
+ timespec64_add_ns(&ret, nsec + tomono.tv_nsec + sleep.tv_nsec);
+ *ts = timespec64_to_timespec(ret);
}
EXPORT_SYMBOL_GPL(get_monotonic_boottime);
@@ -1514,8 +1531,11 @@ EXPORT_SYMBOL_GPL(ktime_get_boottime);
void monotonic_to_bootbased(struct timespec *ts)
{
struct timekeeper *tk = &timekeeper;
+ struct timespec64 ts64;
- *ts = timespec_add(*ts, tk->total_sleep_time);
+ ts64 = timespec_to_timespec64(*ts);
+ ts64 = timespec64_add(ts64, tk->total_sleep_time);
+ *ts = timespec64_to_timespec(ts64);
}
EXPORT_SYMBOL_GPL(monotonic_to_bootbased);
@@ -1531,13 +1551,13 @@ struct timespec __current_kernel_time(vo
{
struct timekeeper *tk = &timekeeper;
- return tk_xtime(tk);
+ return timespec64_to_timespec(tk_xtime(tk));
}
struct timespec current_kernel_time(void)
{
struct timekeeper *tk = &timekeeper;
- struct timespec now;
+ struct timespec64 now;
unsigned long seq;
do {
@@ -1546,14 +1566,14 @@ struct timespec current_kernel_time(void
now = tk_xtime(tk);
} while (read_seqcount_retry(&timekeeper_seq, seq));
- return now;
+ return timespec64_to_timespec(now);
}
EXPORT_SYMBOL(current_kernel_time);
struct timespec get_monotonic_coarse(void)
{
struct timekeeper *tk = &timekeeper;
- struct timespec now, mono;
+ struct timespec64 now, mono;
unsigned long seq;
do {
@@ -1563,9 +1583,10 @@ struct timespec get_monotonic_coarse(voi
mono = tk->wall_to_monotonic;
} while (read_seqcount_retry(&timekeeper_seq, seq));
- set_normalized_timespec(&now, now.tv_sec + mono.tv_sec,
+ set_normalized_timespec64(&now, now.tv_sec + mono.tv_sec,
now.tv_nsec + mono.tv_nsec);
- return now;
+
+ return timespec64_to_timespec(now);
}
/*
@@ -1589,7 +1610,7 @@ ktime_t ktime_get_update_offsets_tick(kt
ktime_t *offs_tai)
{
struct timekeeper *tk = &timekeeper;
- struct timespec ts;
+ struct timespec64 ts;
ktime_t now;
unsigned int seq;
@@ -1597,7 +1618,6 @@ ktime_t ktime_get_update_offsets_tick(kt
seq = read_seqcount_begin(&timekeeper_seq);
ts = tk_xtime(tk);
-
*offs_real = tk->offs_real;
*offs_boot = tk->offs_boot;
*offs_tai = tk->offs_tai;
@@ -1650,14 +1670,14 @@ ktime_t ktime_get_monotonic_offset(void)
{
struct timekeeper *tk = &timekeeper;
unsigned long seq;
- struct timespec wtom;
+ struct timespec64 wtom;
do {
seq = read_seqcount_begin(&timekeeper_seq);
wtom = tk->wall_to_monotonic;
} while (read_seqcount_retry(&timekeeper_seq, seq));
- return timespec_to_ktime(wtom);
+ return timespec64_to_ktime(wtom);
}
EXPORT_SYMBOL_GPL(ktime_get_monotonic_offset);
@@ -1668,7 +1688,8 @@ int do_adjtimex(struct timex *txc)
{
struct timekeeper *tk = &timekeeper;
unsigned long flags;
- struct timespec ts;
+ struct timespec64 ts;
+ struct timespec tmp;
s32 orig_tai, tai;
int ret;
@@ -1688,7 +1709,8 @@ int do_adjtimex(struct timex *txc)
return ret;
}
- getnstimeofday(&ts);
+ getnstimeofday(&tmp);
+ ts = timespec_to_timespec64(tmp);
raw_spin_lock_irqsave(&timekeeper_lock, flags);
write_seqcount_begin(&timekeeper_seq);
Index: tip/kernel/time/timekeeping_debug.c
===================================================================
--- tip.orig/kernel/time/timekeeping_debug.c
+++ tip/kernel/time/timekeeping_debug.c
@@ -67,7 +67,7 @@ static int __init tk_debug_sleep_time_in
}
late_initcall(tk_debug_sleep_time_init);
-void tk_debug_account_sleep_time(struct timespec *t)
+void tk_debug_account_sleep_time(struct timespec64 *t)
{
sleep_time_bin[fls(t->tv_sec)]++;
}
Index: tip/kernel/time/timekeeping_internal.h
===================================================================
--- tip.orig/kernel/time/timekeeping_internal.h
+++ tip/kernel/time/timekeeping_internal.h
@@ -6,7 +6,7 @@
#include <linux/time.h>
#ifdef CONFIG_DEBUG_FS
-extern void tk_debug_account_sleep_time(struct timespec *t);
+extern void tk_debug_account_sleep_time(struct timespec64 *t);
#else
#define tk_debug_account_sleep_time(x)
#endif
next prev parent reply other threads:[~2014-07-11 13:44 UTC|newest]
Thread overview: 93+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-11 13:43 [patch 00/55] timekeeping: 2038, optimizations, NMI safe accessors Thomas Gleixner
2014-07-11 13:43 ` [patch 01/55] tile: Convert VDSO timekeeping to the precise mechanism Thomas Gleixner
2014-07-18 2:32 ` Chris Metcalf
2014-07-11 13:44 ` [patch 02/55] timekeeping: Simplify arch_gettimeoffset() Thomas Gleixner
2014-07-11 14:10 ` Geert Uytterhoeven
2014-07-11 13:44 ` [patch 03/55] hrtimer: Cleanup hrtimer accessors to the timekepeing state Thomas Gleixner
2014-07-11 13:44 ` [patch 04/55] ktime: Kill non-scalar ktime_t implementation for 2038 Thomas Gleixner
2014-07-11 13:44 ` [patch 05/55] ktime: Sanitize ktime_to_us/ms conversion Thomas Gleixner
2014-07-11 13:44 ` [patch 06/55] ktime: Change ktime_set() to take 64bit seconds value Thomas Gleixner
2014-07-11 13:44 ` [patch 07/55] time64: Add time64.h header and define struct timespec64 Thomas Gleixner
2014-07-11 18:41 ` Richard Cochran
2014-07-11 13:44 ` [patch 08/55] time: More core infrastructure for timespec64 Thomas Gleixner
2014-07-11 13:44 ` Thomas Gleixner [this message]
2014-07-11 13:44 ` [patch 10/55] time: Consolidate the time accessor prototypes Thomas Gleixner
2014-07-11 13:44 ` [patch 11/55] timekeeping: Provide timespec64 based interfaces Thomas Gleixner
2014-07-11 13:44 ` [patch 12/55] timekeeper: Move tk_xtime to core code Thomas Gleixner
2014-07-11 13:44 ` [patch 13/55] timekeeping: Cache optimize struct timekeeper Thomas Gleixner
2014-07-11 13:44 ` [patch 14/55] timekeeping: Provide internal ktime_t based data Thomas Gleixner
2014-07-16 3:29 ` John Stultz
2014-07-16 7:00 ` Thomas Gleixner
2014-07-16 7:12 ` Thomas Gleixner
2014-07-16 7:20 ` Peter Zijlstra
2014-07-11 13:44 ` [patch 15/55] timekeeping: Use ktime_t based data for ktime_get() Thomas Gleixner
2014-07-11 13:44 ` [patch 16/55] timekeeping: Provide ktime_get_with_offset() Thomas Gleixner
2014-07-11 13:44 ` [patch 17/55] timekeeping: Use ktime_t based data for ktime_get_real() Thomas Gleixner
2014-07-11 13:44 ` [patch 18/55] timekeeping; Use ktime_t based data for ktime_get_boottime() Thomas Gleixner
2014-07-11 13:44 ` [patch 19/55] timekeeping: Use ktime_t based data for ktime_get_clocktai() Thomas Gleixner
2014-07-11 13:44 ` [patch 20/55] timekeeping: Use ktime_t data for ktime_get_update_offsets_now() Thomas Gleixner
2014-07-11 13:44 ` [patch 21/55] timekeeping; Use ktime based data for ktime_get_update_offsets_tick() Thomas Gleixner
2014-07-11 13:44 ` [patch 22/55] timekeeping: Provide ktime_mono_to_any() Thomas Gleixner
2014-07-11 13:44 ` [patch 23/55] timerfd: Use ktime_mono_to_real() Thomas Gleixner
2014-07-11 13:44 ` [patch 24/55] input: evdev: " Thomas Gleixner
2014-07-11 13:44 ` [patch 25/55] drm: " Thomas Gleixner
2014-07-11 13:44 ` [patch 26/55] timekeeping: Remove ktime_get_monotonic_offset() Thomas Gleixner
2014-07-11 13:44 ` [patch 27/55] timekeeping: Provide ktime_get[*]_ns() helpers Thomas Gleixner
2014-07-11 13:44 ` [patch 28/55] time-export-nsecs-to-jiffies.patch Thomas Gleixner
2014-07-11 13:44 ` [patch 29/55] sched: Make task->real_start_time nanoseconds based Thomas Gleixner
2014-07-11 13:44 ` [patch 30/55] sched: Make task->start_time " Thomas Gleixner
2014-07-11 13:44 ` [patch 31/55] delayacct: Make accounting nanosecond based Thomas Gleixner
2014-07-11 13:44 ` [patch 32/55] delayacct: Remove braindamaged type conversions Thomas Gleixner
2014-07-11 13:44 ` [patch 33/55] powerpc: cell: Use ktime_get_ns() Thomas Gleixner
2014-07-11 17:02 ` Arnd Bergmann
2014-07-11 13:44 ` [patch 34/55] connector: " Thomas Gleixner
2014-07-11 13:44 ` [patch 35/55] mfd: cros_ec_spi: " Thomas Gleixner
2014-07-11 14:52 ` Lee Jones
2014-07-12 19:40 ` Thomas Gleixner
2014-07-14 7:07 ` Lee Jones
2014-07-11 13:44 ` [patch 36/55] misc: ioc4: " Thomas Gleixner
2014-07-11 17:03 ` Arnd Bergmann
2014-07-12 0:26 ` Greg Kroah-Hartman
2014-07-11 13:44 ` [patch 37/55] net: mlx5: " Thomas Gleixner
2014-07-11 13:44 ` [patch 38/55] fs: lockd: " Thomas Gleixner
2014-07-11 14:04 ` Trond Myklebust
2014-07-11 13:44 ` [patch 39/55] hwmon: ibmaem: " Thomas Gleixner
2014-07-11 13:44 ` [patch 40/55] iio: Use ktime_get_real_ns() Thomas Gleixner
2014-07-13 9:21 ` Jonathan Cameron
2014-07-11 13:44 ` [patch 41/55] arm: bL_switcher:k " Thomas Gleixner
2014-07-11 13:44 ` Thomas Gleixner
2014-07-11 13:45 ` [patch 42/55] x86: kvm: Use ktime_get_boot_ns() Thomas Gleixner
2014-07-11 13:45 ` [patch 43/55] x86: kvm: Make kvm_get_time_and_clockread() nanoseconds based Thomas Gleixner
2014-07-11 13:45 ` [patch 44/55] timekeeping: Remove monotonic_to_bootbased Thomas Gleixner
2014-07-11 13:45 ` [patch 45/55] timekeeping: Use ktime_get_boottime() for get_monotonic_boottime() Thomas Gleixner
2014-07-11 13:45 ` [patch 46/55] timekeeping: Provide ktime_get_raw() Thomas Gleixner
2014-07-11 13:45 ` [patch 47/55] hangcheck-timer: Use ktime_get_raw_ns() Thomas Gleixner
2014-07-11 17:03 ` Arnd Bergmann
2014-07-12 0:27 ` Greg Kroah-Hartman
2014-07-11 13:45 ` [patch 48/55] drm: i915: Use nsec based interfaces Thomas Gleixner
2014-07-14 9:21 ` Daniel Vetter
2014-07-14 9:21 ` Daniel Vetter
2014-07-11 13:45 ` [patch 49/55] drm: vmwgfx: " Thomas Gleixner
2014-07-11 13:45 ` [patch 50/55] wireless: ath9k: Get rid of timespec conversions Thomas Gleixner
2014-07-11 13:45 ` [patch 51/55] clocksource: Make delta calculation a function Thomas Gleixner
2014-07-14 8:31 ` Peter Zijlstra
2014-07-16 3:50 ` John Stultz
2014-07-16 6:58 ` Thomas Gleixner
2014-07-11 13:45 ` [patch 52/55] clocksource: Move cycle_last validation to core code Thomas Gleixner
2014-07-11 13:45 ` [patch 53/55] seqcount: Provide raw_read_seqcount() Thomas Gleixner
2014-07-11 13:45 ` [patch 54/55] timekeeping: Provide fast and NMI safe access to CLOCK_MONOTONIC[_RAW] Thomas Gleixner
2014-07-11 20:04 ` Mathieu Desnoyers
2014-07-12 8:11 ` Thomas Gleixner
2014-07-12 13:59 ` Mathieu Desnoyers
2014-07-12 19:31 ` Thomas Gleixner
2014-07-12 14:53 ` Mathieu Desnoyers
2014-07-12 19:28 ` Thomas Gleixner
2014-07-12 20:04 ` Thomas Gleixner
2014-07-12 20:33 ` Mathieu Desnoyers
2014-07-14 8:37 ` Peter Zijlstra
2014-07-14 9:04 ` Thomas Gleixner
2014-07-14 9:45 ` Peter Zijlstra
2014-07-14 9:47 ` Peter Zijlstra
2014-07-14 12:39 ` Mathieu Desnoyers
2014-07-14 14:15 ` Thomas Gleixner
2014-07-11 13:45 ` [patch 55/55] ftrace: Provide trace clocks mono and mono_raw Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140711133705.978234950@linutronix.de \
--to=tglx@linutronix.de \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.