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

clocksource: armada-370-xp: Use atomic access for shared registers

Replace the driver-specific thread-safe shared register API
by the recently introduced atomic_io_clear_set().

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

authored by

Ezequiel Garcia and committed by
Daniel Lezcano
c8af34b4 0a54a069

+4 -8
+4 -8
drivers/clocksource/time-armada-370-xp.c
··· 85 85 86 86 static struct clock_event_device __percpu *armada_370_xp_evt; 87 87 88 - static void timer_ctrl_clrset(u32 clr, u32 set) 89 - { 90 - writel((readl(timer_base + TIMER_CTRL_OFF) & ~clr) | set, 91 - timer_base + TIMER_CTRL_OFF); 92 - } 93 - 94 88 static void local_timer_ctrl_clrset(u32 clr, u32 set) 95 89 { 96 90 writel((readl(local_base + TIMER_CTRL_OFF) & ~clr) | set, ··· 239 245 clr = TIMER0_25MHZ; 240 246 enable_mask = TIMER0_EN | TIMER0_DIV(TIMER_DIVIDER_SHIFT); 241 247 } 242 - timer_ctrl_clrset(clr, set); 248 + atomic_io_modify(timer_base + TIMER_CTRL_OFF, clr | set, set); 243 249 local_timer_ctrl_clrset(clr, set); 244 250 245 251 /* ··· 257 263 writel(0xffffffff, timer_base + TIMER0_VAL_OFF); 258 264 writel(0xffffffff, timer_base + TIMER0_RELOAD_OFF); 259 265 260 - timer_ctrl_clrset(0, TIMER0_RELOAD_EN | enable_mask); 266 + atomic_io_modify(timer_base + TIMER_CTRL_OFF, 267 + TIMER0_RELOAD_EN | enable_mask, 268 + TIMER0_RELOAD_EN | enable_mask); 261 269 262 270 /* 263 271 * Set scale and timer for sched_clock.