[v1,3/7] clocksource/drivers/tegra: Reset hardware state on init
diff mbox series

Message ID 20190424231444.20876-4-digetx@gmail.com
State New
Headers show
Series
  • NVIDIA Tegra clocksource improvements and clean up
Related show

Commit Message

Dmitry Osipenko April 24, 2019, 11:14 p.m. UTC
Reset timer's hardware state to ensure that initially it is in a
predictable state.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/clocksource/timer-tegra20.c | 3 +++
 1 file changed, 3 insertions(+)

Patch
diff mbox series

diff --git a/drivers/clocksource/timer-tegra20.c b/drivers/clocksource/timer-tegra20.c
index 508ca4cdbc60..01d713f20a85 100644
--- a/drivers/clocksource/timer-tegra20.c
+++ b/drivers/clocksource/timer-tegra20.c
@@ -145,6 +145,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);