28 lines
938 B
Diff
28 lines
938 B
Diff
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
|
|
index 9a5464c..6334b5a 100644
|
|
--- a/drivers/clocksource/arm_arch_timer.c
|
|
+++ b/drivers/clocksource/arm_arch_timer.c
|
|
@@ -342,16 +342,17 @@ static u64 notrace arm64_858921_read_cntvct_el0(void)
|
|
* number of CPU cycles in 3 consecutive 24 MHz counter periods.
|
|
*/
|
|
#define __sun50i_a64_read_reg(reg) ({ \
|
|
- u64 _val; \
|
|
- int _retries = 150; \
|
|
+ u64 _old, _new; \
|
|
+ int _retries = 200;
|
|
\
|
|
do { \
|
|
- _val = read_sysreg(reg); \
|
|
+ _old = read_sysreg(reg); \
|
|
+ _new = read_sysreg(reg); \
|
|
_retries--; \
|
|
- } while (((_val + 1) & GENMASK(9, 0)) <= 1 && _retries); \
|
|
+ } } while (unlikely(_old != _new) && _retries); \
|
|
\
|
|
WARN_ON_ONCE(!_retries); \
|
|
- _val; \
|
|
+ _new; \
|
|
})
|
|
|
|
static u64 notrace sun50i_a64_read_cntpct_el0(void)
|