aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource
diff options
context:
space:
mode:
authorNathan Lynch <nathan_lynch@mentor.com>2014-09-28 19:50:06 -0400
committerDaniel Lezcano <daniel.lezcano@linaro.org>2014-09-28 19:59:24 -0400
commit423bd69e69f565167ba14e2fe61df76c3c4a0d26 (patch)
treecb8441d231c0f466aa32d971a820568261109ed1 /drivers/clocksource
parent28cf35675a66947b20731f6acbc9d5b131930ce3 (diff)
clocksource: arm_arch_timer: Change clocksource name if CP15 unavailable
The arm and arm64 VDSOs need CP15 access to the architected counter. If this is unavailable (which is allowed by ARM v7), indicate this by changing the clocksource name to "arch_mem_counter" before registering the clocksource. Suggested by Stephen Boyd. Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/arm_arch_timer.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 7e267e3990ab..e0e7729d37fd 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -429,11 +429,19 @@ static void __init arch_counter_register(unsigned type)
429 u64 start_count; 429 u64 start_count;
430 430
431 /* Register the CP15 based counter if we have one */ 431 /* Register the CP15 based counter if we have one */
432 if (type & ARCH_CP15_TIMER) 432 if (type & ARCH_CP15_TIMER) {
433 arch_timer_read_counter = arch_counter_get_cntvct; 433 arch_timer_read_counter = arch_counter_get_cntvct;
434 else 434 } else {
435 arch_timer_read_counter = arch_counter_get_cntvct_mem; 435 arch_timer_read_counter = arch_counter_get_cntvct_mem;
436 436
437 /* If the clocksource name is "arch_sys_counter" the
438 * VDSO will attempt to read the CP15-based counter.
439 * Ensure this does not happen when CP15-based
440 * counter is not available.
441 */
442 clocksource_counter.name = "arch_mem_counter";
443 }
444
437 start_count = arch_timer_read_counter(); 445 start_count = arch_timer_read_counter();
438 clocksource_register_hz(&clocksource_counter, arch_timer_rate); 446 clocksource_register_hz(&clocksource_counter, arch_timer_rate);
439 cyclecounter.mult = clocksource_counter.mult; 447 cyclecounter.mult = clocksource_counter.mult;