Skip to content

Commit c445bff

Browse files
plappermauldlezcano
authored andcommitted
clocksource/drivers/timer-rtl-otto: Do not interfere with interrupts
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 <markus.stockhausen@gmx.de> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Tested-by: Stephen Howell <howels@allthatwemight.be> Tested-by: Bjørn Mork <bjorn@mork.no> Link: https://lore.kernel.org/r/20250804080328.2609287-4-markus.stockhausen@gmx.de
1 parent ca90147 commit c445bff

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
@@ -141,7 +141,7 @@ static int rttm_next_event(unsigned long delta, struct clock_event_device *clkev
141141

142142
RTTM_DEBUG(to->of_base.base);
143143
rttm_bounce_timer(to->of_base.base, RTTM_CTRL_COUNTER);
144-
rttm_stop_timer(to->of_base.base);
144+
rttm_disable_timer(to->of_base.base);
145145
rttm_set_period(to->of_base.base, delta);
146146
rttm_start_timer(to, RTTM_CTRL_COUNTER);
147147

@@ -154,7 +154,7 @@ static int rttm_state_oneshot(struct clock_event_device *clkevt)
154154

155155
RTTM_DEBUG(to->of_base.base);
156156
rttm_bounce_timer(to->of_base.base, RTTM_CTRL_COUNTER);
157-
rttm_stop_timer(to->of_base.base);
157+
rttm_disable_timer(to->of_base.base);
158158
rttm_set_period(to->of_base.base, RTTM_TICKS_PER_SEC / HZ);
159159
rttm_start_timer(to, RTTM_CTRL_COUNTER);
160160

@@ -167,7 +167,7 @@ static int rttm_state_periodic(struct clock_event_device *clkevt)
167167

168168
RTTM_DEBUG(to->of_base.base);
169169
rttm_bounce_timer(to->of_base.base, RTTM_CTRL_TIMER);
170-
rttm_stop_timer(to->of_base.base);
170+
rttm_disable_timer(to->of_base.base);
171171
rttm_set_period(to->of_base.base, RTTM_TICKS_PER_SEC / HZ);
172172
rttm_start_timer(to, RTTM_CTRL_TIMER);
173173

0 commit comments

Comments
 (0)