aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/vt8500_timer.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-01-12 05:01:12 -0500
committerThomas Gleixner <tglx@linutronix.de>2016-01-12 05:01:12 -0500
commit1f16f116b01c110db20ab808562c8b8bc3ee3d6e (patch)
tree44db563f64cf5f8d62af8f99a61e2b248c44ea3a /drivers/clocksource/vt8500_timer.c
parent03724ac3d48f8f0e3caf1d30fa134f8fd96c94e2 (diff)
parentf9eccf24615672896dc13251410c3f2f33a14f95 (diff)
Merge branches 'clockevents/4.4-fixes' and 'clockevents/4.5-fixes' of http://git.linaro.org/people/daniel.lezcano/linux into timers/urgent
Pull in fixes from Daniel Lezcano: - Fix the vt8500 timer leading to a system lock up when dealing with too small delta (Roman Volkov) - Select the CLKSRC_MMIO when the fsl_ftm_timer is enabled with COMPILE_TEST (Daniel Lezcano) - Prevent to compile timers using the 'iomem' API when the architecture has not HAS_IOMEM set (Richard Weinberger)
Diffstat (limited to 'drivers/clocksource/vt8500_timer.c')
-rw-r--r--drivers/clocksource/vt8500_timer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/clocksource/vt8500_timer.c b/drivers/clocksource/vt8500_timer.c
index de49805fbb09..ddb409274f45 100644
--- a/drivers/clocksource/vt8500_timer.c
+++ b/drivers/clocksource/vt8500_timer.c
@@ -49,6 +49,8 @@
49 49
50#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t) 50#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)
51 51
52#define MIN_OSCR_DELTA 16
53
52static void __iomem *regbase; 54static void __iomem *regbase;
53 55
54static cycle_t vt8500_timer_read(struct clocksource *cs) 56static cycle_t vt8500_timer_read(struct clocksource *cs)
@@ -79,7 +81,7 @@ static int vt8500_timer_set_next_event(unsigned long cycles,
79 cpu_relax(); 81 cpu_relax();
80 writel((unsigned long)alarm, regbase + TIMER_MATCH_VAL); 82 writel((unsigned long)alarm, regbase + TIMER_MATCH_VAL);
81 83
82 if ((signed)(alarm - clocksource.read(&clocksource)) <= 16) 84 if ((signed)(alarm - clocksource.read(&clocksource)) <= MIN_OSCR_DELTA)
83 return -ETIME; 85 return -ETIME;
84 86
85 writel(1, regbase + TIMER_IER_VAL); 87 writel(1, regbase + TIMER_IER_VAL);
@@ -150,7 +152,7 @@ static void __init vt8500_timer_init(struct device_node *np)
150 pr_err("%s: setup_irq failed for %s\n", __func__, 152 pr_err("%s: setup_irq failed for %s\n", __func__,
151 clockevent.name); 153 clockevent.name);
152 clockevents_config_and_register(&clockevent, VT8500_TIMER_HZ, 154 clockevents_config_and_register(&clockevent, VT8500_TIMER_HZ,
153 4, 0xf0000000); 155 MIN_OSCR_DELTA * 2, 0xf0000000);
154} 156}
155 157
156CLOCKSOURCE_OF_DECLARE(vt8500, "via,vt8500-timer", vt8500_timer_init); 158CLOCKSOURCE_OF_DECLARE(vt8500, "via,vt8500-timer", vt8500_timer_init);