clocksource/drivers/tegra: Reset hardware state on init
authorDmitry Osipenko <digetx@gmail.com>
Mon, 3 Jun 2019 18:59:41 +0000 (21:59 +0300)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Tue, 25 Jun 2019 17:49:18 +0000 (19:49 +0200)
Reset timer's hardware state to ensure that initially it is in a
predictable state.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-By: Peter De Schrijver <pdeschrijver@nvidia.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/clocksource/timer-tegra20.c

index acd68c77fa910dd424cdf3e609a219fa8dc15804..3e4f12aee8df1170aaaa79ea58e52885ece47e82 100644 (file)
@@ -123,6 +123,9 @@ static int tegra_timer_setup(unsigned int cpu)
 {
        struct timer_of *to = per_cpu_ptr(&tegra_to, cpu);
 
+       writel(0, timer_of_base(to) + TIMER_PTV);
+       writel(TIMER_PCR_INTR_CLR, timer_of_base(to) + TIMER_PCR);
+
        irq_force_affinity(to->clkevt.irq, cpumask_of(cpu));
        enable_irq(to->clkevt.irq);