mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 00:34:20 +08:00
timekeeping: Remove timekeeper.total_sleep_time
No more users. Remove it Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
This commit is contained in:
parent
02cba1598a
commit
47da70d325
@ -20,8 +20,8 @@
|
||||
* the tv_nsec part positive so we can use the usual normalization.
|
||||
*
|
||||
* wall_to_monotonic is moved after resume from suspend for the
|
||||
* monotonic time not to jump. We need to add total_sleep_time to
|
||||
* wall_to_monotonic to get the real boot based time offset.
|
||||
* monotonic time not to jump. To calculate the real boot time offset
|
||||
* we need to do offs_real - offs_boot.
|
||||
*
|
||||
* - wall_to_monotonic is no longer the boot time, getboottime must be
|
||||
* used instead.
|
||||
@ -51,8 +51,6 @@ struct timekeeper {
|
||||
/* Offset clock monotonic -> clock tai */
|
||||
ktime_t offs_tai;
|
||||
|
||||
/* time spent in suspend */
|
||||
struct timespec64 total_sleep_time;
|
||||
/* The current UTC to TAI offset in seconds */
|
||||
s32 tai_offset;
|
||||
|
||||
|
@ -97,13 +97,9 @@ static void tk_set_wall_to_mono(struct timekeeper *tk, struct timespec64 wtm)
|
||||
tk->offs_tai = ktime_add(tk->offs_real, ktime_set(tk->tai_offset, 0));
|
||||
}
|
||||
|
||||
static void tk_set_sleep_time(struct timekeeper *tk, struct timespec64 t)
|
||||
static inline void tk_update_sleep_time(struct timekeeper *tk, ktime_t delta)
|
||||
{
|
||||
/* Verify consistency before modifying */
|
||||
WARN_ON_ONCE(tk->offs_boot.tv64 != timespec64_to_ktime(tk->total_sleep_time).tv64);
|
||||
|
||||
tk->total_sleep_time = t;
|
||||
tk->offs_boot = timespec64_to_ktime(t);
|
||||
tk->offs_boot = ktime_add(tk->offs_boot, delta);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -919,10 +915,6 @@ void __init timekeeping_init(void)
|
||||
set_normalized_timespec64(&tmp, -boot.tv_sec, -boot.tv_nsec);
|
||||
tk_set_wall_to_mono(tk, tmp);
|
||||
|
||||
tmp.tv_sec = 0;
|
||||
tmp.tv_nsec = 0;
|
||||
tk_set_sleep_time(tk, tmp);
|
||||
|
||||
timekeeping_update(tk, TK_MIRROR);
|
||||
|
||||
write_seqcount_end(&tk_core.seq);
|
||||
@ -950,7 +942,7 @@ static void __timekeeping_inject_sleeptime(struct timekeeper *tk,
|
||||
}
|
||||
tk_xtime_add(tk, 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_update_sleep_time(tk, timespec64_to_ktime(*delta));
|
||||
tk_debug_account_sleep_time(delta);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user