]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
UBUNTU: SAUCE: arm64: arch_timer: Make workaround methods optional
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 27 Jan 2017 10:34:13 +0000 (10:34 +0000)
committerTim Gardner <tim.gardner@canonical.com>
Tue, 28 Mar 2017 20:17:54 +0000 (14:17 -0600)
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>
arch/arm64/include/asm/arch_timer.h

index 58572d38e9db3432d672938bc9af4506c5b65544..d46cf21e8b80a85bcb652fcb53d183c2b990ca62 100644 (file)
@@ -61,8 +61,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;                                           \