]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
arm64: arch_timer: Make workaround methods optional
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 27 Jan 2017 10:34:13 +0000 (10:34 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Fri, 7 Apr 2017 10:22:09 +0000 (11:22 +0100)
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>
arch/arm64/include/asm/arch_timer.h

index cc1e08127fb4828af64691019d7297380d606d05..01917b4c65cae9c1b2233bf3217208b05564a966 100644 (file)
@@ -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;                                           \