Commit 57f27666 authored by Marc Zyngier's avatar Marc Zyngier Committed by Will Deacon

clocksource/arm_arch_timer: Drop use of static key in arch_timer_reg_read_stable

Let's start with the removal of the arch_timer_read_ool_enabled
static key in arch_timer_reg_read_stable. It is not a fast path,
and we can simplify things a bit.
Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 5ef19a16
...@@ -77,23 +77,37 @@ struct arch_timer_erratum_workaround { ...@@ -77,23 +77,37 @@ struct arch_timer_erratum_workaround {
DECLARE_PER_CPU(const struct arch_timer_erratum_workaround *, DECLARE_PER_CPU(const struct arch_timer_erratum_workaround *,
timer_unstable_counter_workaround); timer_unstable_counter_workaround);
/* inline sysreg accessors that make erratum_handler() work */
static inline notrace u32 arch_timer_read_cntp_tval_el0(void)
{
return read_sysreg(cntp_tval_el0);
}
static inline notrace u32 arch_timer_read_cntv_tval_el0(void)
{
return read_sysreg(cntv_tval_el0);
}
static inline notrace u64 arch_timer_read_cntpct_el0(void)
{
return read_sysreg(cntpct_el0);
}
static inline notrace u64 arch_timer_read_cntvct_el0(void)
{
return read_sysreg(cntvct_el0);
}
#define arch_timer_reg_read_stable(reg) \ #define arch_timer_reg_read_stable(reg) \
({ \ ({ \
u64 _val; \ u64 _val; \
if (needs_unstable_timer_counter_workaround()) { \ \
const struct arch_timer_erratum_workaround *wa; \
preempt_disable_notrace(); \ preempt_disable_notrace(); \
wa = __this_cpu_read(timer_unstable_counter_workaround); \ _val = erratum_handler(read_ ## reg)(); \
if (wa && wa->read_##reg) \
_val = wa->read_##reg(); \
else \
_val = read_sysreg(reg); \
preempt_enable_notrace(); \ preempt_enable_notrace(); \
} else { \ \
_val = read_sysreg(reg); \ _val; \
} \ })
_val; \
})
/* /*
* These register accessors are marked inline so the compiler can * These register accessors are marked inline so the compiler can
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment