aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/arm_arch_timer.c
diff options
context:
space:
mode:
authorScott Wood <oss@buserror.net>2016-09-22 04:35:18 -0400
committerWill Deacon <will.deacon@arm.com>2016-09-23 12:19:25 -0400
commit1d8f51d41fc7116f3753fe9f9a5dd93e0b550a2c (patch)
treeabbb60533f4f4de2f8b543241a8c7bb1913a2dab /drivers/clocksource/arm_arch_timer.c
parentf6dc1576cd517440313c9551b6ffa3d7e389c7c7 (diff)
arm/arm64: arch_timer: Use archdata to indicate vdso suitability
Instead of comparing the name to a magic string, use archdata to explicitly communicate whether the arch timer is suitable for direct vdso access. Acked-by: Will Deacon <will.deacon@arm.com> Acked-by: Russell King <rmk+kernel@armlinux.org.uk> Acked-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Scott Wood <oss@buserror.net> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/clocksource/arm_arch_timer.c')
-rw-r--r--drivers/clocksource/arm_arch_timer.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index eb5fb4121ac8..73c487da6d2a 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -602,23 +602,18 @@ static void __init arch_counter_register(unsigned type)
602 else 602 else
603 arch_timer_read_counter = arch_counter_get_cntpct; 603 arch_timer_read_counter = arch_counter_get_cntpct;
604 604
605 clocksource_counter.archdata.vdso_direct = true;
606
605#ifdef CONFIG_FSL_ERRATUM_A008585 607#ifdef CONFIG_FSL_ERRATUM_A008585
606 /* 608 /*
607 * Don't use the vdso fastpath if errata require using 609 * Don't use the vdso fastpath if errata require using
608 * the out-of-line counter accessor. 610 * the out-of-line counter accessor.
609 */ 611 */
610 if (static_branch_unlikely(&arch_timer_read_ool_enabled)) 612 if (static_branch_unlikely(&arch_timer_read_ool_enabled))
611 clocksource_counter.name = "arch_sys_counter_ool"; 613 clocksource_counter.archdata.vdso_direct = false;
612#endif 614#endif
613 } else { 615 } else {
614 arch_timer_read_counter = arch_counter_get_cntvct_mem; 616 arch_timer_read_counter = arch_counter_get_cntvct_mem;
615
616 /* If the clocksource name is "arch_sys_counter" the
617 * VDSO will attempt to read the CP15-based counter.
618 * Ensure this does not happen when CP15-based
619 * counter is not available.
620 */
621 clocksource_counter.name = "arch_mem_counter";
622 } 617 }
623 618
624 start_count = arch_timer_read_counter(); 619 start_count = arch_timer_read_counter();