Skip to content

Commit a165afd

Browse files
plappermaulopsiff
authored andcommitted
clocksource/drivers/timer-rtl-otto: Do not interfere with interrupts
[ Upstream commit c445bff ] During normal operation the timers are reprogrammed including an interrupt acknowledgement. This has no effect as the whole timer is setup from scratch afterwards. Especially in an interrupt this has already been done by rttm_timer_interrupt(). Change the behaviour as follows: - Use rttm_disable_timer() during reprogramming - Keep rttm_stop_timer() for all other use cases. Downstream has already tested and confirmed a patch. See openwrt/openwrt#19468 https://forum.openwrt.org/t/support-for-rtl838x-based-managed-switches/57875/3788 Signed-off-by: Markus Stockhausen <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Tested-by: Stephen Howell <[email protected]> Tested-by: Bjørn Mork <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 8cc561dd9d02f1753ae34dfdd565662828be9a9d)
1 parent 1103a78 commit a165afd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/clocksource/timer-rtl-otto.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static int rttm_next_event(unsigned long delta, struct clock_event_device *clkev
147147

148148
RTTM_DEBUG(to->of_base.base);
149149
rttm_bounce_timer(to->of_base.base, RTTM_CTRL_COUNTER);
150-
rttm_stop_timer(to->of_base.base);
150+
rttm_disable_timer(to->of_base.base);
151151
rttm_set_period(to->of_base.base, delta);
152152
rttm_start_timer(to, RTTM_CTRL_COUNTER);
153153

@@ -160,7 +160,7 @@ static int rttm_state_oneshot(struct clock_event_device *clkevt)
160160

161161
RTTM_DEBUG(to->of_base.base);
162162
rttm_bounce_timer(to->of_base.base, RTTM_CTRL_COUNTER);
163-
rttm_stop_timer(to->of_base.base);
163+
rttm_disable_timer(to->of_base.base);
164164
rttm_set_period(to->of_base.base, RTTM_TICKS_PER_SEC / HZ);
165165
rttm_start_timer(to, RTTM_CTRL_COUNTER);
166166

@@ -173,7 +173,7 @@ static int rttm_state_periodic(struct clock_event_device *clkevt)
173173

174174
RTTM_DEBUG(to->of_base.base);
175175
rttm_bounce_timer(to->of_base.base, RTTM_CTRL_TIMER);
176-
rttm_stop_timer(to->of_base.base);
176+
rttm_disable_timer(to->of_base.base);
177177
rttm_set_period(to->of_base.base, RTTM_TICKS_PER_SEC / HZ);
178178
rttm_start_timer(to, RTTM_CTRL_TIMER);
179179

0 commit comments

Comments
 (0)