From patchwork Mon Apr 13 17:37:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Jeppsson X-Patchwork-Id: 6210621 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 59D46BF4A6 for ; Mon, 13 Apr 2015 17:40:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 798C8202EB for ; Mon, 13 Apr 2015 17:40:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9B17A201BB for ; Mon, 13 Apr 2015 17:40:08 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YhiJ5-0003Y2-Te; Mon, 13 Apr 2015 17:37:59 +0000 Received: from mail-lb0-f181.google.com ([209.85.217.181]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YhiJ0-0003Q3-Ps for linux-arm-kernel@lists.infradead.org; Mon, 13 Apr 2015 17:37:55 +0000 Received: by lbcga7 with SMTP id ga7so65268120lbc.1 for ; Mon, 13 Apr 2015 10:37: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:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=QlPTTjv40gVkC5E29mAB4oJZRCELI8mhRt9BOzuVHQI=; b=czRZt1CaS0B33ixNj/Mf7LU07Yuv5W5oE7IbwqimBGYqLCA0XmCcMWvxlPTHKZa1i4 nVkMZINkLOheepjiOgp68D81XWvtISi63BUQ2hmW0KGcNLxGcNABgZD/WKiTGrmSz6Y+ ANurUdi3X0aa2n4SjDS8pf9TAuB+lR5c03eEydLEGNVSd7pmlhkZ0acHYVhDY+ZUcE8H xWWgpicw5LN4CJaHFUto82ReK2//8sw+t42o6pboWBgd5qvljBYAEQoDKa/+QIpz2FTo YxX8LJIDNcIh+ZeR2q9QsuazDC5doAb2Lh6I+d8vPVviRgfJs/284AOaXd4MENSpioaP 39Cw== X-Gm-Message-State: ALoCoQnbnjtpQQ4+s5p2gIV1ccqFDdBCMqSXPlo53D7wbT7LdnpqLLEVjiWhSfg/W+ahBsgnhnvj X-Received: by 10.112.98.201 with SMTP id ek9mr14320433lbb.68.1428946652099; Mon, 13 Apr 2015 10:37:32 -0700 (PDT) Received: from [192.168.0.143] (tulip.olf.sgsnet.se. [46.239.120.142]) by mx.google.com with ESMTPSA id jl4sm1814235lbc.14.2015.04.13.10.37.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Apr 2015 10:37:31 -0700 (PDT) Message-ID: <552BFED9.3020105@adapteva.com> Date: Mon, 13 Apr 2015 19:37:29 +0200 From: Ola Jeppsson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] clocksource: arm_global_timer: Detect if gt is usable with CPU_FREQ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150413_103755_082421_E8FB9956 X-CRM114-Status: GOOD ( 11.45 ) X-Spam-Score: -0.7 (/) Cc: devicetree@vger.kernel.org, Arnd Bergmann , Srinivas Kandagatla , Michal Simek , Stuart Menefy , Olof Johansson , =?UTF-8?B?U8O2cmVuIEJyaW5rbWFubg==?= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some Cortex A9 CPU:s (e.g. zynq) have the tick tied to the CPU frequency. On those CPU:s we cannot use the global-timer as a reliable clocksource with CPU frequency scaling enabled since this is not currently taken into account by the driver. Add a "tied-to-cpu-freq" boolean to the global-timer dt node indicate this condition. When the global-timer register function sees this property return immediately and don't register the clocksource. Signed-off-by: Ola Jeppsson --- Documentation/devicetree/bindings/arm/global_timer.txt | 4 ++++ drivers/clocksource/arm_global_timer.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/global_timer.txt b/Documentation/devicetree/bindings/arm/global_timer.txt index bdae3a818793..465e02c17b5b 100644 --- a/Documentation/devicetree/bindings/arm/global_timer.txt +++ b/Documentation/devicetree/bindings/arm/global_timer.txt @@ -17,6 +17,10 @@ - clocks : Should be phandle to a clock. +** Timer node optional properties: + +- tied-to-cpu-freq : indicates that the timer scales with the CPU frequency. + Example: timer@2c000600 { diff --git a/drivers/clocksource/arm_global_timer.c b/drivers/clocksource/arm_global_timer.c index e6833771a716..8913ebda3f09 100644 --- a/drivers/clocksource/arm_global_timer.c +++ b/drivers/clocksource/arm_global_timer.c @@ -268,6 +268,13 @@ static void __init global_timer_of_register(struct device_node *np) return; } +#ifdef CONFIG_CPU_FREQ + if (of_property_read_bool(np, "tied-to-cpu-freq")) { + pr_warn("global-timer: tied to cpu frequency, not supported with scaling\n"); + return; + } +#endif + gt_clk = of_clk_get(np, 0); if (!IS_ERR(gt_clk)) { err = clk_prepare_enable(gt_clk);