From patchwork Mon Sep 29 00:23:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 38053 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7E7DC202DB for ; Mon, 29 Sep 2014 00:25:12 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id mc6sf4808612lab.11 for ; Sun, 28 Sep 2014 17:25:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=igplSs4C9KkEDFvD6o6fdlgUNdbEf+0gPC5Hb4TVRAs=; b=IYOVGpJ/7m1sz+MyK4oplx9yQGMCVnfOH4nYKDErQ9fq1scEwCdcvmI1TOjHwlwbPf RtQrO0VvE3Iky9yu02y7Dg5JjfcJZSdkaajhD8Hj0rBH21uxcLtkPNASLnBxR/yndsxt dgBZsLzl3s5rMlc6agm3lMrGrO9LMtpa+F/axlhSl1AmPbip9iurczLbDZg5IQZP2xry WzdbArddm0X0U8XQALSjdbrUIMbi23okK7Dg582kCK9fwIzdjYsJlhAbRjyc9O1koFkA hSRIE5DVce5ZKygeoxXAM8ooxagu0XrBGjYD4FNIm0EvCv5qcfo9F7urmhhDQfMYE2tv 4uOA== X-Gm-Message-State: ALoCoQkjtOv67T0u70P41pY7VBpY7ZvayLX4KRshckHU2t/t9DwkFqz67Zfj0xdMGE/kx1+VKKEs X-Received: by 10.112.225.41 with SMTP id rh9mr1907296lbc.5.1411950311251; Sun, 28 Sep 2014 17:25:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.10.1 with SMTP id e1ls353187lab.51.gmail; Sun, 28 Sep 2014 17:25:10 -0700 (PDT) X-Received: by 10.112.17.2 with SMTP id k2mr33920844lbd.28.1411950310852; Sun, 28 Sep 2014 17:25:10 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) by mx.google.com with ESMTPS id rd1si16328676lbb.101.2014.09.28.17.25.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 28 Sep 2014 17:25:10 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id w7so225435lbi.36 for ; Sun, 28 Sep 2014 17:25:10 -0700 (PDT) X-Received: by 10.112.128.135 with SMTP id no7mr33419553lbb.74.1411950310749; Sun, 28 Sep 2014 17:25:10 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp98642lbb; Sun, 28 Sep 2014 17:25:09 -0700 (PDT) X-Received: by 10.70.123.136 with SMTP id ma8mr67583936pdb.139.1411950309178; Sun, 28 Sep 2014 17:25:09 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2si20595880pbz.19.2014.09.28.17.25.08 for ; Sun, 28 Sep 2014 17:25:09 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754492AbaI2AYV (ORCPT + 27 others); Sun, 28 Sep 2014 20:24:21 -0400 Received: from mail-wg0-f43.google.com ([74.125.82.43]:33770 "EHLO mail-wg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753968AbaI2AYF (ORCPT ); Sun, 28 Sep 2014 20:24:05 -0400 Received: by mail-wg0-f43.google.com with SMTP id a1so904892wgh.26 for ; Sun, 28 Sep 2014 17:24:04 -0700 (PDT) X-Received: by 10.180.38.10 with SMTP id c10mr24141525wik.57.1411950244157; Sun, 28 Sep 2014 17:24:04 -0700 (PDT) Received: from localhost.localdomain (AToulouse-656-1-925-235.w90-55.abo.wanadoo.fr. [90.55.46.235]) by mx.google.com with ESMTPSA id h5sm14014311wje.8.2014.09.28.17.24.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 28 Sep 2014 17:24:03 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de, mingo@kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 12/13] clocksource: arm_arch_timer: Enable counter access for 32-bit ARM Date: Mon, 29 Sep 2014 02:23:45 +0200 Message-Id: <1411950226-21598-12-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1411950226-21598-1-git-send-email-daniel.lezcano@linaro.org> References: <5428A559.5050908@linaro.org> <1411950226-21598-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Nathan Lynch The only difference between arm and arm64's implementations of arch_counter_set_user_access is that 32-bit ARM does not enable user access to the virtual counter. We want to enable this access for the 32-bit ARM VDSO, so copy the arm64 version to the driver itself, and remove the arch-specific implementations. Signed-off-by: Nathan Lynch Signed-off-by: Daniel Lezcano Acked-by: Will Deacon --- arch/arm/include/asm/arch_timer.h | 14 -------------- arch/arm64/include/asm/arch_timer.h | 17 ----------------- drivers/clocksource/arm_arch_timer.c | 17 +++++++++++++++++ 3 files changed, 17 insertions(+), 31 deletions(-) diff --git a/arch/arm/include/asm/arch_timer.h b/arch/arm/include/asm/arch_timer.h index 0704e0c..b7ae444 100644 --- a/arch/arm/include/asm/arch_timer.h +++ b/arch/arm/include/asm/arch_timer.h @@ -99,20 +99,6 @@ static inline void arch_timer_set_cntkctl(u32 cntkctl) asm volatile("mcr p15, 0, %0, c14, c1, 0" : : "r" (cntkctl)); } -static inline void arch_counter_set_user_access(void) -{ - u32 cntkctl = arch_timer_get_cntkctl(); - - /* Disable user access to both physical/virtual counters/timers */ - /* Also disable virtual event stream */ - cntkctl &= ~(ARCH_TIMER_USR_PT_ACCESS_EN - | ARCH_TIMER_USR_VT_ACCESS_EN - | ARCH_TIMER_VIRT_EVT_EN - | ARCH_TIMER_USR_VCT_ACCESS_EN - | ARCH_TIMER_USR_PCT_ACCESS_EN); - arch_timer_set_cntkctl(cntkctl); -} - static inline void arch_timer_evtstrm_enable(int divider) { u32 cntkctl = arch_timer_get_cntkctl(); diff --git a/arch/arm64/include/asm/arch_timer.h b/arch/arm64/include/asm/arch_timer.h index 9400596..49e94c6 100644 --- a/arch/arm64/include/asm/arch_timer.h +++ b/arch/arm64/include/asm/arch_timer.h @@ -104,23 +104,6 @@ static inline void arch_timer_set_cntkctl(u32 cntkctl) asm volatile("msr cntkctl_el1, %0" : : "r" (cntkctl)); } -static inline void arch_counter_set_user_access(void) -{ - u32 cntkctl = arch_timer_get_cntkctl(); - - /* Disable user access to the timers and the physical counter */ - /* Also disable virtual event stream */ - cntkctl &= ~(ARCH_TIMER_USR_PT_ACCESS_EN - | ARCH_TIMER_USR_VT_ACCESS_EN - | ARCH_TIMER_VIRT_EVT_EN - | ARCH_TIMER_USR_PCT_ACCESS_EN); - - /* Enable user access to the virtual counter */ - cntkctl |= ARCH_TIMER_USR_VCT_ACCESS_EN; - - arch_timer_set_cntkctl(cntkctl); -} - static inline void arch_timer_evtstrm_enable(int divider) { u32 cntkctl = arch_timer_get_cntkctl(); diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index e0e7729..42bd445 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -312,6 +312,23 @@ static void arch_timer_configure_evtstream(void) arch_timer_evtstrm_enable(min(pos, 15)); } +static void arch_counter_set_user_access(void) +{ + u32 cntkctl = arch_timer_get_cntkctl(); + + /* Disable user access to the timers and the physical counter */ + /* Also disable virtual event stream */ + cntkctl &= ~(ARCH_TIMER_USR_PT_ACCESS_EN + | ARCH_TIMER_USR_VT_ACCESS_EN + | ARCH_TIMER_VIRT_EVT_EN + | ARCH_TIMER_USR_PCT_ACCESS_EN); + + /* Enable user access to the virtual counter */ + cntkctl |= ARCH_TIMER_USR_VCT_ACCESS_EN; + + arch_timer_set_cntkctl(cntkctl); +} + static int arch_timer_setup(struct clock_event_device *clk) { __arch_timer_setup(ARCH_CP15_TIMER, clk);