Skip to content

Commit 9ab2b7f

Browse files
author
Ingo Molnar
committed
Merge branch 'clockevents/4.0-rc2' of http://git.linaro.org/people/daniel.lezcano/linux into timers/urgent
Pull clockevents fixes from Daniel Lezcano: " These two patches fix a potential crash at boot time. - Fix setup_irq / clockevents_config_and_register init ordering in order to prevent to have an interrupt to be fired before the handler is set for sun5i and efm32. (Yongbae Park)" Signed-off-by: Ingo Molnar <mingo@kernel.org>
2 parents 13a7a6a + 1096be0 commit 9ab2b7f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

drivers/clocksource/time-efm32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,12 @@ static int __init efm32_clockevent_init(struct device_node *np)
225225
clock_event_ddata.base = base;
226226
clock_event_ddata.periodic_top = DIV_ROUND_CLOSEST(rate, 1024 * HZ);
227227

228-
setup_irq(irq, &efm32_clock_event_irq);
229-
230228
clockevents_config_and_register(&clock_event_ddata.evtdev,
231229
DIV_ROUND_CLOSEST(rate, 1024),
232230
0xf, 0xffff);
233231

232+
setup_irq(irq, &efm32_clock_event_irq);
233+
234234
return 0;
235235

236236
err_get_irq:

drivers/clocksource/timer-sun5i.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,6 @@ static void __init sun5i_timer_init(struct device_node *node)
178178

179179
ticks_per_jiffy = DIV_ROUND_UP(rate, HZ);
180180

181-
ret = setup_irq(irq, &sun5i_timer_irq);
182-
if (ret)
183-
pr_warn("failed to setup irq %d\n", irq);
184-
185181
/* Enable timer0 interrupt */
186182
val = readl(timer_base + TIMER_IRQ_EN_REG);
187183
writel(val | TIMER_IRQ_EN(0), timer_base + TIMER_IRQ_EN_REG);
@@ -191,6 +187,10 @@ static void __init sun5i_timer_init(struct device_node *node)
191187

192188
clockevents_config_and_register(&sun5i_clockevent, rate,
193189
TIMER_SYNC_TICKS, 0xffffffff);
190+
191+
ret = setup_irq(irq, &sun5i_timer_irq);
192+
if (ret)
193+
pr_warn("failed to setup irq %d\n", irq);
194194
}
195195
CLOCKSOURCE_OF_DECLARE(sun5i_a13, "allwinner,sun5i-a13-hstimer",
196196
sun5i_timer_init);

0 commit comments

Comments
 (0)