BugLink: https://bugs.launchpad.net/bugs/1675509
Not all errata need to workaround all access types. Allow them to
be optional.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
(cherry picked from commit
7ecb0c2a0e111449128d17f559f0d0c6828d784c
in the timers/errata-rework branch of
git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
#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; \