[U-Boot] [PATCH 2/2] arm: timer: sunxi: fix spurious timeout issues

Oskari Lemmela oskari at lemmela.net
Sat Jan 5 17:52:16 UTC 2019


Fixes spurious timeouts which have seen during testing SPI driver.
Timeouts disappear when number of bits are reduced to 10.

Timer tiny backward jumps causes spurious timeouts.

Signed-off-by: Oskari Lemmela <oskari at lemmela.net>
---
 arch/arm/cpu/armv8/generic_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv8/generic_timer.c b/arch/arm/cpu/armv8/generic_timer.c
index c1706dcec1..2e06ee4ed2 100644
--- a/arch/arm/cpu/armv8/generic_timer.c
+++ b/arch/arm/cpu/armv8/generic_timer.c
@@ -66,7 +66,7 @@ unsigned long timer_read_counter(void)
 	isb();
 	do {
 		asm volatile("mrs %0, cntpct_el0" : "=r" (cntpct));
-	} while (((cntpct + 1) & GENMASK(10, 0)) <= 1);
+	} while (((cntpct + 1) & GENMASK(9, 0)) <= 1);
 
 	return cntpct;
 }
-- 
2.17.1



More information about the U-Boot mailing list