From patchwork Fri May 23 10:31:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 30698 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 185472066E for ; Fri, 23 May 2014 10:33:33 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id lc6sf15934131vcb.11 for ; Fri, 23 May 2014 03:33:32 -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=nLcSk/mFfV7+8tEnfidolqm3mwWL/SX0ISB4x8RVL8g=; b=ctlUpkxZ9v5qOTrJ2eQ8diPiwku/AGh41rbma/eR9x71gjWj+TyC23SKDLT1ap0zO4 b+SEs+A2CVBuxbrgK95t9RJqM53mTtJjOmghlSmDqkIOqNwwHtINnpxqomD+jCtLCFf+ iqsmZddeyOEO4lVV3VWBexZ+xUdHLYWlTby2mZ+yKVBP0nqA6XCME6NIr8cQRhfx+XDK wabpEWEuy322GG7O/xDHc9UsBQQrysvXis6Um4SHdNNWJSV2UdD9axNV/0O71Tau5DNY Ywfav4VDEwIYImmXRHyY2CDVC4cKb1xOdeoobELpRKWwIFXfinPpr8dPXdDfIuiyqP76 i/GQ== X-Gm-Message-State: ALoCoQnDNxDjgGtfrIG3c8/hwU7obJZWQyuoQyajQxJUGfeynYX5mAttE2SXepn28qJum2O+r5Ih X-Received: by 10.224.90.2 with SMTP id g2mr1783741qam.1.1400841212704; Fri, 23 May 2014 03:33:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.115 with SMTP id e106ls1696696qgd.65.gmail; Fri, 23 May 2014 03:33:32 -0700 (PDT) X-Received: by 10.52.163.98 with SMTP id yh2mr2828017vdb.5.1400841212637; Fri, 23 May 2014 03:33:32 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id v15si1397212vei.0.2014.05.23.03.33.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 03:33:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id la4so6079122vcb.27 for ; Fri, 23 May 2014 03:33:32 -0700 (PDT) X-Received: by 10.52.14.130 with SMTP id p2mr1121434vdc.39.1400841212568; Fri, 23 May 2014 03:33:32 -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.220.221.72 with SMTP id ib8csp19854vcb; Fri, 23 May 2014 03:33:32 -0700 (PDT) X-Received: by 10.68.110.129 with SMTP id ia1mr4711059pbb.158.1400841211256; Fri, 23 May 2014 03:33:31 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kh4si3193982pbc.255.2014.05.23.03.33.30 for ; Fri, 23 May 2014 03:33:30 -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 S1753178AbaEWKc5 (ORCPT + 27 others); Fri, 23 May 2014 06:32:57 -0400 Received: from mail-we0-f179.google.com ([74.125.82.179]:53250 "EHLO mail-we0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753129AbaEWKcw (ORCPT ); Fri, 23 May 2014 06:32:52 -0400 Received: by mail-we0-f179.google.com with SMTP id q59so4608034wes.38 for ; Fri, 23 May 2014 03:32:51 -0700 (PDT) X-Received: by 10.180.182.115 with SMTP id ed19mr2355135wic.29.1400841171183; Fri, 23 May 2014 03:32:51 -0700 (PDT) Received: from localhost.localdomain (AToulouse-654-1-404-187.w82-125.abo.wanadoo.fr. [82.125.3.187]) by mx.google.com with ESMTPSA id s9sm2200908wix.13.2014.05.23.03.32.50 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 03:32:50 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de, mingo@kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 60/71] clocksource: qcom: Implement read_current_timer for udelay Date: Fri, 23 May 2014 12:31:40 +0200 Message-Id: <1400841111-6683-60-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1400841111-6683-1-git-send-email-daniel.lezcano@linaro.org> References: <537F214C.8000700@linaro.org> <1400841111-6683-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.220.182 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: Stephen Boyd Setup the same timer used as the clocksource to be used as the read_current_timer implementation. This allows us to support a stable udelay implementation on MSMs where it's possible for the CPUs to scale speeds independently of one another. Signed-off-by: Stephen Boyd Signed-off-by: Daniel Lezcano --- drivers/clocksource/qcom-timer.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/clocksource/qcom-timer.c b/drivers/clocksource/qcom-timer.c index e807acf..8d115db 100644 --- a/drivers/clocksource/qcom-timer.c +++ b/drivers/clocksource/qcom-timer.c @@ -26,6 +26,8 @@ #include #include +#include + #define TIMER_MATCH_VAL 0x0000 #define TIMER_COUNT_VAL 0x0004 #define TIMER_ENABLE 0x0008 @@ -179,6 +181,15 @@ static u64 notrace msm_sched_clock_read(void) return msm_clocksource.read(&msm_clocksource); } +static unsigned long msm_read_current_timer(void) +{ + return msm_clocksource.read(&msm_clocksource); +} + +static struct delay_timer msm_delay_timer = { + .read_current_timer = msm_read_current_timer, +}; + static void __init msm_timer_init(u32 dgt_hz, int sched_bits, int irq, bool percpu) { @@ -217,6 +228,8 @@ err: if (res) pr_err("clocksource_register failed\n"); sched_clock_register(msm_sched_clock_read, sched_bits, dgt_hz); + msm_delay_timer.freq = dgt_hz; + register_current_timer_delay(&msm_delay_timer); } #ifdef CONFIG_ARCH_QCOM