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

clocksource/drivers/arm_arch_timer: Use stable count reader in erratum sne

In commit 0ea415390cd3 ("clocksource/arm_arch_timer: Use arch_timer_read_counter
to access stable counters"), we separate stable and normal count reader to omit
unnecessary overhead on systems that have no timer erratum.

However, in erratum_set_next_event_tval_generic(), count reader becomes normal
reader. This converts it to stable reader.

Fixes: 0ea415390cd3 ("clocksource/arm_arch_timer: Use arch_timer_read_counter to access stable counters")
Acked-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20201204073126.6920-2-zhukeqian1@huawei.com

authored by

Keqian Zhu and committed by
Daniel Lezcano
d8cc3905 5d9814df

+2 -2
+2 -2
drivers/clocksource/arm_arch_timer.c
··· 396 396 ctrl &= ~ARCH_TIMER_CTRL_IT_MASK; 397 397 398 398 if (access == ARCH_TIMER_PHYS_ACCESS) { 399 - cval = evt + arch_counter_get_cntpct(); 399 + cval = evt + arch_counter_get_cntpct_stable(); 400 400 write_sysreg(cval, cntp_cval_el0); 401 401 } else { 402 - cval = evt + arch_counter_get_cntvct(); 402 + cval = evt + arch_counter_get_cntvct_stable(); 403 403 write_sysreg(cval, cntv_cval_el0); 404 404 } 405 405