mirror of
https://github.com/Fishwaldo/build.git
synced 2025-07-23 13:29:33 +00:00
add fix-a64-timejump patch
This commit is contained in:
parent
140da6ad43
commit
d688244fea
1 changed files with 27 additions and 0 deletions
27
patch/kernel/sunxi-dev/fix-a64-timejump.patch
Normal file
27
patch/kernel/sunxi-dev/fix-a64-timejump.patch
Normal file
|
@ -0,0 +1,27 @@
|
|||
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)
|
Loading…
Add table
Add a link
Reference in a new issue