Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clocksource: tcb_clksrc: Make tc_mode interrupt safe

tc_mode() can be called from interrupt context and thus must not call
clk_*prepare*() functions.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

authored by

David Jander and committed by
Daniel Lezcano
acbf6d21 f214be50

+4 -4
+4 -4
drivers/clocksource/tcb_clksrc.c
··· 100 100 || tcd->clkevt.mode == CLOCK_EVT_MODE_ONESHOT) { 101 101 __raw_writel(0xff, regs + ATMEL_TC_REG(2, IDR)); 102 102 __raw_writel(ATMEL_TC_CLKDIS, regs + ATMEL_TC_REG(2, CCR)); 103 - clk_disable_unprepare(tcd->clk); 103 + clk_disable(tcd->clk); 104 104 } 105 105 106 106 switch (m) { ··· 109 109 * of oneshot, we get lower overhead and improved accuracy. 110 110 */ 111 111 case CLOCK_EVT_MODE_PERIODIC: 112 - clk_prepare_enable(tcd->clk); 112 + clk_enable(tcd->clk); 113 113 114 114 /* slow clock, count up to RC, then irq and restart */ 115 115 __raw_writel(timer_clock ··· 126 126 break; 127 127 128 128 case CLOCK_EVT_MODE_ONESHOT: 129 - clk_prepare_enable(tcd->clk); 129 + clk_enable(tcd->clk); 130 130 131 131 /* slow clock, count up to RC, then irq and stop */ 132 132 __raw_writel(timer_clock | ATMEL_TC_CPCSTOP ··· 194 194 ret = clk_prepare_enable(t2_clk); 195 195 if (ret) 196 196 return ret; 197 - clk_disable_unprepare(t2_clk); 197 + clk_disable(t2_clk); 198 198 199 199 clkevt.regs = tc->regs; 200 200 clkevt.clk = t2_clk;