From a6a585a209065ba5e248144632e9373ea9126185 Mon Sep 17 00:00:00 2001 From: Neeraj Upadhyay Date: Fri, 5 Jan 2018 11:03:42 +0530 Subject: [PATCH] clocksource: arch_timer: Disable user access to the physical counter Disable user access to physical counter. This reverts commit 63cb2598d5ba ("clocksource: arch_timer: Enable user access to the physical counter"). This could potentially break the userspace applications using physical counters; but all those usages should move to using virtual counter, to get the timing information. Change-Id: I653816a93515507a400ff23dbaa4442bf614a79b Signed-off-by: Neeraj Upadhyay --- drivers/clocksource/arm_arch_timer.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 893c91a45e47..6760f84faf06 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -326,13 +326,14 @@ static void arch_counter_set_user_access(void) { u32 cntkctl = arch_timer_get_cntkctl(); - /* Disable user access to the timers */ + /* Disable user access to the timers and the physical counter */ /* Also disable virtual event stream */ cntkctl &= ~(ARCH_TIMER_USR_PT_ACCESS_EN - | ARCH_TIMER_VIRT_EVT_EN); + | ARCH_TIMER_VIRT_EVT_EN + | ARCH_TIMER_USR_PCT_ACCESS_EN); - /* Enable user access to the virtual and physical counters */ - cntkctl |= ARCH_TIMER_USR_PCT_ACCESS_EN | ARCH_TIMER_USR_VT_ACCESS_EN; + /* Enable user access to the virtual counter */ + cntkctl |= ARCH_TIMER_USR_VT_ACCESS_EN; if (IS_ENABLED(CONFIG_ARM_ARCH_TIMER_VCT_ACCESS)) cntkctl |= ARCH_TIMER_USR_VCT_ACCESS_EN;