Lines Matching refs:clock
100 .clock = &dummy_clock, \
194 struct clocksource *clock = READ_ONCE(tkr->clock); in tk_clock_read() local
196 return clock->read(clock); in tk_clock_read()
205 u64 max_cycles = tk->tkr_mono.clock->max_cycles; in timekeeping_check_update()
206 const char *name = tk->tkr_mono.clock->name; in timekeeping_check_update()
259 max = tkr->clock->max_cycles; in timekeeping_get_delta()
276 delta = tkr->clock->max_cycles; in timekeeping_get_delta()
310 static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock) in tk_setup_internals() argument
317 old_clock = tk->tkr_mono.clock; in tk_setup_internals()
318 tk->tkr_mono.clock = clock; in tk_setup_internals()
319 tk->tkr_mono.mask = clock->mask; in tk_setup_internals()
322 tk->tkr_raw.clock = clock; in tk_setup_internals()
323 tk->tkr_raw.mask = clock->mask; in tk_setup_internals()
328 tmp <<= clock->shift; in tk_setup_internals()
330 tmp += clock->mult/2; in tk_setup_internals()
331 do_div(tmp, clock->mult); in tk_setup_internals()
339 tk->xtime_interval = interval * clock->mult; in tk_setup_internals()
341 tk->raw_interval = interval * clock->mult; in tk_setup_internals()
345 int shift_change = clock->shift - old_clock->shift; in tk_setup_internals()
355 tk->tkr_mono.shift = clock->shift; in tk_setup_internals()
356 tk->tkr_raw.shift = clock->shift; in tk_setup_internals()
359 tk->ntp_error_shift = NTP_SCALE_SHIFT - clock->shift; in tk_setup_internals()
367 tk->tkr_mono.mult = clock->mult; in tk_setup_internals()
368 tk->tkr_raw.mult = clock->mult; in tk_setup_internals()
642 tkr_dummy.clock = &dummy_clock; in halt_fast_timekeeper()
648 tkr_dummy.clock = &dummy_clock; in halt_fast_timekeeper()
1056 systime_snapshot->cs_id = tk->tkr_mono.clock->id; in ktime_get_snapshot()
1232 if (tk->tkr_mono.clock != system_counterval.cs) in get_device_system_crosststamp()
1469 old = tk->tkr_mono.clock; in change_clocksource()
1495 int timekeeping_notify(struct clocksource *clock) in timekeeping_notify() argument
1499 if (tk->tkr_mono.clock == clock) in timekeeping_notify()
1501 stop_machine(change_clocksource, clock, NULL); in timekeeping_notify()
1503 return tk->tkr_mono.clock == clock ? 0 : -1; in timekeeping_notify()
1543 ret = tk->tkr_mono.clock->flags & CLOCK_SOURCE_VALID_FOR_HRES; in timekeeping_valid_for_hres()
1562 ret = tk->tkr_mono.clock->max_idle_ns; in timekeeping_max_deferment()
1631 struct clocksource *clock; in timekeeping_init() local
1656 clock = clocksource_default_clock(); in timekeeping_init()
1657 if (clock->enable) in timekeeping_init()
1658 clock->enable(clock); in timekeeping_init()
1659 tk_setup_internals(tk, clock); in timekeeping_init()
1775 struct clocksource *clock = tk->tkr_mono.clock; in timekeeping_resume() local
1802 nsec = clocksource_stop_suspend_timing(clock, cycle_now); in timekeeping_resume()
1865 curr_clock = tk->tkr_mono.clock; in timekeeping_suspend()
2024 if (unlikely(tk->tkr_mono.clock->maxadj && in timekeeping_adjust()
2025 (abs(tk->tkr_mono.mult - tk->tkr_mono.clock->mult) in timekeeping_adjust()
2026 > tk->tkr_mono.clock->maxadj))) { in timekeeping_adjust()
2029 tk->tkr_mono.clock->name, (long)tk->tkr_mono.mult, in timekeeping_adjust()
2030 (long)tk->tkr_mono.clock->mult + tk->tkr_mono.clock->maxadj); in timekeeping_adjust()
2406 struct clocksource *clock = READ_ONCE(tkr->clock); in random_get_entropy_fallback() local
2408 if (unlikely(timekeeping_suspended || !clock)) in random_get_entropy_fallback()
2410 return clock->read(clock); in random_get_entropy_fallback()