[PATCH 11/29] arm64: arch_timer: Make workaround methods optional

From
Daniel Lezcano <hidden>
Date
2017-04-16 20:28:24
Also in
lkml
Reply to
Daniel Lezcano, 2017-04-16
From: Marc Zyngier <redacted>

Not all errata need to workaround all access types. Allow them to
be optional.

Acked-by: Thomas Gleixner <redacted>
Signed-off-by: Marc Zyngier <redacted>
---
 arch/arm64/include/asm/arch_timer.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/include/asm/arch_timer.h b/arch/arm64/include/asm/arch_timer.h
index cc1e081..01917b4 100644
--- a/arch/arm64/include/asm/arch_timer.h
+++ b/arch/arm64/include/asm/arch_timer.h
@@ -60,8 +60,9 @@ extern const struct arch_timer_erratum_workaround *timer_unstable_counter_workar
 #define arch_timer_reg_read_stable(reg) 		\
 ({							\
 	u64 _val;					\
-	if (needs_unstable_timer_counter_workaround())		\
-		_val = timer_unstable_counter_workaround->read_##reg();\
+	if (needs_unstable_timer_counter_workaround() &&		\
+	    timer_unstable_counter_workaround->read_##reg)		\
+		_val = timer_unstable_counter_workaround->read_##reg();	\
 	else						\
 		_val = read_sysreg(reg);		\
 	_val;						\
-- 
2.7.4
Thread (26 messages) 26 messages, 3 authors, last reply 2017-04-24
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help