Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e6d7c2a authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge branch 'timers/core' into perf/timer, to apply dependent patch



An upcoming patch will depend on tai_ns() and NMI-safe ktime_get_raw_fast(),
so merge timers/core here in a separate topic branch until it's all cooked
and timers/core is merged upstream.

Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 3c435c1e fe5fba05
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ int __init omap_init_clocksource_32k(void __iomem *vbase)

	/*
	 * 120000 rough estimate from the calculations in
	 * __clocksource_updatefreq_scale.
	 * __clocksource_update_freq_scale.
	 */
	clocks_calc_mult_shift(&persistent_mult, &persistent_shift,
			32768, NSEC_PER_SEC, 120000);
+5 −5
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm,
void update_vsyscall(struct timekeeper *tk)
{
	struct timespec xtime_coarse;
	u32 use_syscall = strcmp(tk->tkr.clock->name, "arch_sys_counter");
	u32 use_syscall = strcmp(tk->tkr_mono.clock->name, "arch_sys_counter");

	++vdso_data->tb_seq_count;
	smp_wmb();
@@ -213,11 +213,11 @@ void update_vsyscall(struct timekeeper *tk)
	vdso_data->wtm_clock_nsec		= tk->wall_to_monotonic.tv_nsec;

	if (!use_syscall) {
		vdso_data->cs_cycle_last	= tk->tkr.cycle_last;
		vdso_data->cs_cycle_last	= tk->tkr_mono.cycle_last;
		vdso_data->xtime_clock_sec	= tk->xtime_sec;
		vdso_data->xtime_clock_nsec	= tk->tkr.xtime_nsec;
		vdso_data->cs_mult		= tk->tkr.mult;
		vdso_data->cs_shift		= tk->tkr.shift;
		vdso_data->xtime_clock_nsec	= tk->tkr_mono.xtime_nsec;
		vdso_data->cs_mult		= tk->tkr_mono.mult;
		vdso_data->cs_shift		= tk->tkr_mono.shift;
	}

	smp_wmb();
+10 −10
Original line number Diff line number Diff line
@@ -215,20 +215,20 @@ void update_vsyscall(struct timekeeper *tk)
{
	u64 nsecps;

	if (tk->tkr.clock != &clocksource_tod)
	if (tk->tkr_mono.clock != &clocksource_tod)
		return;

	/* Make userspace gettimeofday spin until we're done. */
	++vdso_data->tb_update_count;
	smp_wmb();
	vdso_data->xtime_tod_stamp = tk->tkr.cycle_last;
	vdso_data->xtime_tod_stamp = tk->tkr_mono.cycle_last;
	vdso_data->xtime_clock_sec = tk->xtime_sec;
	vdso_data->xtime_clock_nsec = tk->tkr.xtime_nsec;
	vdso_data->xtime_clock_nsec = tk->tkr_mono.xtime_nsec;
	vdso_data->wtom_clock_sec =
		tk->xtime_sec + tk->wall_to_monotonic.tv_sec;
	vdso_data->wtom_clock_nsec = tk->tkr.xtime_nsec +
		+ ((u64) tk->wall_to_monotonic.tv_nsec << tk->tkr.shift);
	nsecps = (u64) NSEC_PER_SEC << tk->tkr.shift;
	vdso_data->wtom_clock_nsec = tk->tkr_mono.xtime_nsec +
		+ ((u64) tk->wall_to_monotonic.tv_nsec << tk->tkr_mono.shift);
	nsecps = (u64) NSEC_PER_SEC << tk->tkr_mono.shift;
	while (vdso_data->wtom_clock_nsec >= nsecps) {
		vdso_data->wtom_clock_nsec -= nsecps;
		vdso_data->wtom_clock_sec++;
@@ -236,7 +236,7 @@ void update_vsyscall(struct timekeeper *tk)

	vdso_data->xtime_coarse_sec = tk->xtime_sec;
	vdso_data->xtime_coarse_nsec =
		(long)(tk->tkr.xtime_nsec >> tk->tkr.shift);
		(long)(tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift);
	vdso_data->wtom_coarse_sec =
		vdso_data->xtime_coarse_sec + tk->wall_to_monotonic.tv_sec;
	vdso_data->wtom_coarse_nsec =
@@ -246,8 +246,8 @@ void update_vsyscall(struct timekeeper *tk)
		vdso_data->wtom_coarse_sec++;
	}

	vdso_data->tk_mult = tk->tkr.mult;
	vdso_data->tk_shift = tk->tkr.shift;
	vdso_data->tk_mult = tk->tkr_mono.mult;
	vdso_data->tk_shift = tk->tkr_mono.shift;
	smp_wmb();
	++vdso_data->tb_update_count;
}
@@ -283,7 +283,7 @@ void __init time_init(void)
	if (register_external_irq(EXT_IRQ_TIMING_ALERT, timing_alert_interrupt))
		panic("Couldn't request external interrupt 0x1406");

	if (clocksource_register(&clocksource_tod) != 0)
	if (__clocksource_register(&clocksource_tod) != 0)
		panic("Could not register TOD clock source");

	/* Enable TOD clock interrupts on the boot cpu. */
+1 −5
Original line number Diff line number Diff line
@@ -181,17 +181,13 @@ static struct clocksource timer_cs = {
	.rating	= 100,
	.read	= timer_cs_read,
	.mask	= CLOCKSOURCE_MASK(64),
	.shift	= 2,
	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
};

static __init int setup_timer_cs(void)
{
	timer_cs_enabled = 1;
	timer_cs.mult = clocksource_hz2mult(sparc_config.clock_rate,
	                                    timer_cs.shift);

	return clocksource_register(&timer_cs);
	return clocksource_register_hz(&timer_cs, sparc_config.clock_rate);
}

#ifdef CONFIG_SMP
+12 −12
Original line number Diff line number Diff line
@@ -257,34 +257,34 @@ void update_vsyscall_tz(void)

void update_vsyscall(struct timekeeper *tk)
{
	if (tk->tkr.clock != &cycle_counter_cs)
	if (tk->tkr_mono.clock != &cycle_counter_cs)
		return;

	write_seqcount_begin(&vdso_data->tb_seq);

	vdso_data->cycle_last		= tk->tkr.cycle_last;
	vdso_data->mask			= tk->tkr.mask;
	vdso_data->mult			= tk->tkr.mult;
	vdso_data->shift		= tk->tkr.shift;
	vdso_data->cycle_last		= tk->tkr_mono.cycle_last;
	vdso_data->mask			= tk->tkr_mono.mask;
	vdso_data->mult			= tk->tkr_mono.mult;
	vdso_data->shift		= tk->tkr_mono.shift;

	vdso_data->wall_time_sec	= tk->xtime_sec;
	vdso_data->wall_time_snsec	= tk->tkr.xtime_nsec;
	vdso_data->wall_time_snsec	= tk->tkr_mono.xtime_nsec;

	vdso_data->monotonic_time_sec	= tk->xtime_sec
					+ tk->wall_to_monotonic.tv_sec;
	vdso_data->monotonic_time_snsec	= tk->tkr.xtime_nsec
	vdso_data->monotonic_time_snsec	= tk->tkr_mono.xtime_nsec
					+ ((u64)tk->wall_to_monotonic.tv_nsec
						<< tk->tkr.shift);
						<< tk->tkr_mono.shift);
	while (vdso_data->monotonic_time_snsec >=
					(((u64)NSEC_PER_SEC) << tk->tkr.shift)) {
					(((u64)NSEC_PER_SEC) << tk->tkr_mono.shift)) {
		vdso_data->monotonic_time_snsec -=
					((u64)NSEC_PER_SEC) << tk->tkr.shift;
					((u64)NSEC_PER_SEC) << tk->tkr_mono.shift;
		vdso_data->monotonic_time_sec++;
	}

	vdso_data->wall_time_coarse_sec	= tk->xtime_sec;
	vdso_data->wall_time_coarse_nsec = (long)(tk->tkr.xtime_nsec >>
						 tk->tkr.shift);
	vdso_data->wall_time_coarse_nsec = (long)(tk->tkr_mono.xtime_nsec >>
						 tk->tkr_mono.shift);

	vdso_data->monotonic_time_coarse_sec =
		vdso_data->wall_time_coarse_sec + tk->wall_to_monotonic.tv_sec;
Loading