clocksource/arm_arch_timer: Use arch_timer_read_counter to access stable counters
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 8 Apr 2019 15:49:07 +0000 (16:49 +0100)
committerWill Deacon <will.deacon@arm.com>
Tue, 30 Apr 2019 15:12:54 +0000 (16:12 +0100)
commit0ea415390cd345b7d09e8c9ebd4b68adfe873043
tree42ee44177c52347a95d17106ce1d89bc87bad7ac
parenta862fc2254bdbcee3b5da4f730984e5d8393a2f1
clocksource/arm_arch_timer: Use arch_timer_read_counter to access stable counters

Instead of always going via arch_counter_get_cntvct_stable to access the
counter workaround, let's have arch_timer_read_counter point to the
right method.

For that, we need to track whether any CPU in the system has a
workaround for the counter. This is done by having an atomic variable
tracking this.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm/include/asm/arch_timer.h
arch/arm64/include/asm/arch_timer.h
drivers/clocksource/arm_arch_timer.c