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

Configure Feed

Select the types of activity you want to include in your feed.

clocksource/drivers/timer-rtl-otto: Drop set_counter function

The current counter value is a read only register. It will be
reset when writing a new target timer value with rttm_set_period().
rttm_set_counter() is essentially a noop. Drop it.

While this makes rttm_start_timer() and rttm_enable_timer() the
same functions keep both to make the established abstraction layers
for register and control functions active.

Downstream has already tested and confirmed a patch. See
https://github.com/openwrt/openwrt/pull/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-3-markus.stockhausen@gmx.de

authored by

Markus Stockhausen and committed by
Daniel Lezcano
ca90147e e7a25106

-6
-6
drivers/clocksource/timer-rtl-otto.c
··· 56 56 }; 57 57 58 58 /* Simple internal register functions */ 59 - static inline void rttm_set_counter(void __iomem *base, unsigned int counter) 60 - { 61 - iowrite32(counter, base + RTTM_CNT); 62 - } 63 - 64 59 static inline unsigned int rttm_get_counter(void __iomem *base) 65 60 { 66 61 return ioread32(base + RTTM_CNT); ··· 132 137 133 138 static void rttm_start_timer(struct timer_of *to, u32 mode) 134 139 { 135 - rttm_set_counter(to->of_base.base, 0); 136 140 rttm_enable_timer(to->of_base.base, mode, to->of_clk.rate / RTTM_TICKS_PER_SEC); 137 141 } 138 142