aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2017-01-27 10:34:13 +0000
committerMarc Zyngier <marc.zyngier@arm.com>2017-04-07 11:22:09 +0100
commit8c64621bf9501902a3086a5e38135344b3161128 (patch)
tree9f07bf064ffc0e0557ffa0f8180270d840c19661
parentarm64: arch_timer: Rework the set_next_event workarounds (diff)
downloadlinux-dev-8c64621bf9501902a3086a5e38135344b3161128.tar.xz
linux-dev-8c64621bf9501902a3086a5e38135344b3161128.zip
arm64: arch_timer: Make workaround methods optional
Not all errata need to workaround all access types. Allow them to be optional. Acked-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r--arch/arm64/include/asm/arch_timer.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/arch_timer.h b/arch/arm64/include/asm/arch_timer.h
index cc1e08127fb4..01917b4c65ca 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; \