Commit d9bd24c3 authored by Russell King's avatar Russell King Committed by Ben Hutchings

ARM: fix footbridge clockevent device

commit 4ff859fe upstream.

The clockevents code was being told that the footbridge clock event
device ticks at 16x the rate which it actually does.  This leads to
timekeeping problems since it allows the clocksource to wrap before
the kernel notices.  Fix this by using the correct clock.

Fixes: 4e8d7637 ("ARM: footbridge: convert to clockevents/clocksource")
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
[bwh: Backported to 3.2: fold in the relevant parts of commit 838a2ae8
 ('ARM: use clockevents_config_and_register() where possible')]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 5826e620
......@@ -95,17 +95,14 @@ static struct irqaction footbridge_timer_irq = {
static void __init footbridge_timer_init(void)
{
struct clock_event_device *ce = &ckevt_dc21285;
unsigned rate = DIV_ROUND_CLOSEST(mem_fclk_21285, 16);
clocksource_register_hz(&cksrc_dc21285, (mem_fclk_21285 + 8) / 16);
clocksource_register_hz(&cksrc_dc21285, rate);
setup_irq(ce->irq, &footbridge_timer_irq);
clockevents_calc_mult_shift(ce, mem_fclk_21285, 5);
ce->max_delta_ns = clockevent_delta2ns(0xffffff, ce);
ce->min_delta_ns = clockevent_delta2ns(0x000004, ce);
ce->cpumask = cpumask_of(smp_processor_id());
clockevents_register_device(ce);
clockevents_config_and_register(ce, rate, 0x4, 0xffffff);
}
struct sys_timer footbridge_timer = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment