Lines Matching +full:timing +full:- +full:adjustment

1 // SPDX-License-Identifier: GPL-2.0
60 u64 clock_comparator_max = -1ULL;
110 * Scheduler clock - returns current time in nanosec units.
122 sec = clk->us; in ext_to_timespec64()
124 nsec = ((clk->sus + (rem << 12)) * 125) >> 9; in ext_to_timespec64()
125 xt->tv_sec = sec; in ext_to_timespec64()
126 xt->tv_nsec = nsec; in ext_to_timespec64()
133 get_lowcore()->clock_comparator = clock_comparator_max; in clock_comparator_work()
135 cd->event_handler(cd); in clock_comparator_work()
141 get_lowcore()->clock_comparator = get_tod_clock() + delta; in s390_next_event()
142 set_clock_comparator(get_lowcore()->clock_comparator); in s390_next_event()
155 get_lowcore()->clock_comparator = clock_comparator_max; in init_cpu_timer()
156 set_clock_comparator(get_lowcore()->clock_comparator); in init_cpu_timer()
160 cd->name = "comparator"; in init_cpu_timer()
161 cd->features = CLOCK_EVT_FEAT_ONESHOT; in init_cpu_timer()
162 cd->mult = 16777; in init_cpu_timer()
163 cd->shift = 12; in init_cpu_timer()
164 cd->min_delta_ns = 1; in init_cpu_timer()
165 cd->min_delta_ticks = 1; in init_cpu_timer()
166 cd->max_delta_ns = LONG_MAX; in init_cpu_timer()
167 cd->max_delta_ticks = ULONG_MAX; in init_cpu_timer()
168 cd->rating = 400; in init_cpu_timer()
169 cd->cpumask = cpumask_of(cpu); in init_cpu_timer()
170 cd->set_next_event = s390_next_event; in init_cpu_timer()
177 /* Always allow the timing alert external interrupt. */ in init_cpu_timer()
186 if (get_lowcore()->clock_comparator == clock_comparator_max) in clock_comparator_interrupt()
187 set_clock_comparator(get_lowcore()->clock_comparator); in clock_comparator_interrupt()
209 clk.eitod -= delta; in read_persistent_clock64()
222 clk.eitod -= delta; in read_persistent_wall_and_boot_offset()
235 adj = tod_steering_end - now; in read_tod_clock()
243 now += (tod_steering_delta < 0) ? (adj >> 15) : -(adj >> 15); in read_tod_clock()
278 /* request the timing alert external interrupt */ in time_init()
304 * source. If the clock mode is local it will return -EOPNOTSUPP and
305 * -EAGAIN if the clock is not in sync with the external reference.
314 *clock = get_tod_clock() - lpar_offset; in get_phys_clock()
321 return -EOPNOTSUPP; in get_phys_clock()
323 return -EACCES; in get_phys_clock()
324 return -EAGAIN; in get_phys_clock()
329 * Make get_phys_clock() return -EAGAIN.
335 * Clear the in-sync bit 2^31. All get_phys_clock calls will in disable_sync_clock()
382 adj = tod_steering_end - now; in clock_sync_global()
384 /* Calculate how much of the old adjustment is left. */ in clock_sync_global()
386 -(adj >> 15) : (adj >> 15); in clock_sync_global()
405 * Apply clock delta to the per-CPU data structures of this CPU.
411 if (get_lowcore()->clock_comparator != clock_comparator_max) { in clock_sync_local()
412 get_lowcore()->clock_comparator += delta; in clock_sync_local()
413 set_clock_comparator(get_lowcore()->clock_comparator); in clock_sync_local()
415 /* Adjust the last_update_clock time-stamp. */ in clock_sync_local()
416 get_lowcore()->last_update_clock += delta; in clock_sync_local()
497 * STP timing alert. There are three causes:
498 * 1) timing status change
506 if (intparm->tsc || intparm->lac || intparm->tcpc) in stp_timing_alert()
511 * STP sync check machine check. This is called when the timing state
525 * have matching CTN ids and have a valid stratum-1 configuration
565 while (atomic_read(&sync->cpus) != 0) in stp_sync_clock()
573 sync->clock_delta = clock_delta; in stp_sync_clock()
577 rc = -EAGAIN; in stp_sync_clock()
581 sync->in_sync = rc ? -EAGAIN : 1; in stp_sync_clock()
585 atomic_dec(&sync->cpus); in stp_sync_clock()
587 while (READ_ONCE(sync->in_sync) == 0) in stp_sync_clock()
590 if (sync->in_sync != 1) in stp_sync_clock()
591 /* Didn't work. Clear per-cpu in sync bit again. */ in stp_sync_clock()
593 /* Apply clock delta to per-CPU fields of this CPU. */ in stp_sync_clock()
594 clock_sync_local(sync->clock_delta); in stp_sync_clock()
639 timediff = tod_to_ns(lsoib->nlsout - get_tod_clock()) / NSEC_PER_SEC; in stp_check_leap()
640 leapdiff = lsoib->nlso - lsoib->also; in stp_check_leap()
642 if (leapdiff != 1 && leapdiff != -1) { in stp_check_leap()
704 atomic_set(&stp_sync.cpus, num_online_cpus() - 1); in stp_work_fn()
734 ssize_t ret = -ENODATA; in ctn_id_show()
750 ssize_t ret = -ENODATA; in ctn_type_show()
765 ssize_t ret = -ENODATA; in dst_offset_show()
780 ssize_t ret = -ENODATA; in leap_seconds_show()
801 return -ENODATA; in leap_seconds_scheduled_show()
813 tod_to_ns(stzi.lsoib.nlsout - TOD_UNIX_EPOCH) / NSEC_PER_SEC, in leap_seconds_scheduled_show()
814 stzi.lsoib.nlso - stzi.lsoib.also); in leap_seconds_scheduled_show()
823 ssize_t ret = -ENODATA; in stratum_show()
838 ssize_t ret = -ENODATA; in time_offset_show()
853 ssize_t ret = -ENODATA; in time_zone_offset_show()
868 ssize_t ret = -ENODATA; in timing_mode_show()
883 ssize_t ret = -ENODATA; in timing_state_show()
909 return -EINVAL; in online_store()
911 return -EOPNOTSUPP; in online_store()