Lines Matching refs:tkd

658 static void tk_update_leap_state_all(struct tk_data *tkd)  in tk_update_leap_state_all()  argument
660 write_seqcount_begin(&tkd->seq); in tk_update_leap_state_all()
661 tk_update_leap_state(&tkd->shadow_timekeeper); in tk_update_leap_state_all()
662 tkd->timekeeper.next_leap_ktime = tkd->shadow_timekeeper.next_leap_ktime; in tk_update_leap_state_all()
663 write_seqcount_end(&tkd->seq); in tk_update_leap_state_all()
702 static void timekeeping_restore_shadow(struct tk_data *tkd) in timekeeping_restore_shadow() argument
704 lockdep_assert_held(&tkd->lock); in timekeeping_restore_shadow()
705 memcpy(&tkd->shadow_timekeeper, &tkd->timekeeper, sizeof(tkd->timekeeper)); in timekeeping_restore_shadow()
708 static void timekeeping_update_from_shadow(struct tk_data *tkd, unsigned int action) in timekeeping_update_from_shadow() argument
710 struct timekeeper *tk = &tkd->shadow_timekeeper; in timekeeping_update_from_shadow()
712 lockdep_assert_held(&tkd->lock); in timekeeping_update_from_shadow()
721 write_seqcount_begin(&tkd->seq); in timekeeping_update_from_shadow()
753 memcpy(&tkd->timekeeper, tk, sizeof(*tk)); in timekeeping_update_from_shadow()
754 write_seqcount_end(&tkd->seq); in timekeeping_update_from_shadow()
1480 static int __timekeeping_inject_offset(struct tk_data *tkd, const struct timespec64 *ts) in __timekeeping_inject_offset() argument
1482 struct timekeeper *tks = &tkd->shadow_timekeeper; in __timekeeping_inject_offset()
1495 timekeeping_restore_shadow(tkd); in __timekeeping_inject_offset()
1512 timekeeping_restore_shadow(tkd); in __timekeeping_inject_offset()
1518 timekeeping_update_from_shadow(tkd, TK_UPDATE_ALL); in __timekeeping_inject_offset()
1772 static __init void tkd_basic_setup(struct tk_data *tkd, enum timekeeper_ids tk_id, bool valid) in tkd_basic_setup() argument
1774 raw_spin_lock_init(&tkd->lock); in tkd_basic_setup()
1775 seqcount_raw_spinlock_init(&tkd->seq, &tkd->lock); in tkd_basic_setup()
1776 tkd->timekeeper.id = tkd->shadow_timekeeper.id = tk_id; in tkd_basic_setup()
1777 tkd->timekeeper.clock_valid = tkd->shadow_timekeeper.clock_valid = valid; in tkd_basic_setup()
2321 static bool __timekeeping_advance(struct tk_data *tkd, enum timekeeping_adv_mode mode) in __timekeeping_advance() argument
2323 struct timekeeper *tk = &tkd->shadow_timekeeper; in __timekeeping_advance()
2324 struct timekeeper *real_tk = &tkd->timekeeper; in __timekeeping_advance()
2377 timekeeping_update_from_shadow(tkd, clock_set); in __timekeeping_advance()
2692 static int __do_adjtimex(struct tk_data *tkd, struct __kernel_timex *txc, in __do_adjtimex() argument
2695 struct timekeeper *tks = &tkd->shadow_timekeeper; in __do_adjtimex()
2710 tk_get_aux_ts64(tkd->timekeeper.id, &ts); in __do_adjtimex()
2714 guard(raw_spinlock_irqsave)(&tkd->lock); in __do_adjtimex()
2724 ret = __timekeeping_inject_offset(tkd, &result->delta); in __do_adjtimex()
2735 timekeeping_update_from_shadow(tkd, TK_CLOCK_WAS_SET); in __do_adjtimex()
2743 result->clock_set |= __timekeeping_advance(tkd, TK_ADV_FREQ); in __do_adjtimex()
2827 struct tk_data *tkd = &timekeeper_data[id + TIMEKEEPER_AUX_FIRST]; in tk_aux_update_clocksource() local
2828 struct timekeeper *tks = &tkd->shadow_timekeeper; in tk_aux_update_clocksource()
2830 guard(raw_spinlock_irqsave)(&tkd->lock); in tk_aux_update_clocksource()
2836 timekeeping_update_from_shadow(tkd, TK_UPDATE_ALL); in tk_aux_update_clocksource()