From patchwork Tue Jun 18 08:16:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 2739831 Return-Path: X-Original-To: patchwork-ltsi-dev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6AAFAC0AB1 for ; Tue, 18 Jun 2013 08:16:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45D1A201E7 for ; Tue, 18 Jun 2013 08:16:26 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) by mail.kernel.org (Postfix) with ESMTP id 1C451201B5 for ; Tue, 18 Jun 2013 08:16:25 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [IPv6:::1]) by mail.linuxfoundation.org (Postfix) with ESMTP id E9651976; Tue, 18 Jun 2013 08:16:24 +0000 (UTC) X-Original-To: ltsi-dev@lists.linuxfoundation.org Delivered-To: ltsi-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTP id E6D3E975 for ; Tue, 18 Jun 2013 08:16:23 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 70B0A1F897 for ; Tue, 18 Jun 2013 08:16:22 +0000 (UTC) Received: by mail-pd0-f170.google.com with SMTP id x11so3679523pdj.15 for ; Tue, 18 Jun 2013 01:16:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:subject; bh=gCCz/pm04Em3bVzGQOg8yX+8tX2nBr131CfCj/WSqj0=; b=JIDjrN9E/7VbLfWHfonroN03VF+hH7/WQXnNIvj6k24+dLSQkoRHtPhjRKna5N3O6o i20ide2eFr+ss6eAG3mXmBLCfG+Hi5eyc1xzk3vyYdJKWUENsaGP2Ogd5lqZKvtR74Z9 lL7MRcbIAO/fLbMV2G/fmtHgVWVmjCcDlJEQV8AWNkJi8Ja7RojoxdLHem10vQZEUHMV LWETewqtd9gNQPKX8Uket301lHyQNnsZWBg/pv3SaZ8xDopsDJp9bZGCXNKVhzijKYrB /AQcMAg6v+xkCYMy/j3T2HxYyEbkhCFy0mMvrDAlQeAlPF+KIjbsxR88uwMXT1AF0l7O Texw== X-Received: by 10.66.135.18 with SMTP id po18mr1237487pab.1.1371543382208; Tue, 18 Jun 2013 01:16:22 -0700 (PDT) Received: from [127.0.0.1] (ac230065.ppp.asahi-net.or.jp. [183.77.230.65]) by mx.google.com with ESMTPSA id fl2sm18506240pab.23.2013.06.18.01.16.19 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Jun 2013 01:16:21 -0700 (PDT) From: Magnus Damm To: ltsi-dev@lists.linuxfoundation.org Date: Tue, 18 Jun 2013 17:16:22 +0900 Message-Id: <20130618081622.22750.48485.sendpatchset@w520> X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org Cc: shinya.kuribayashi.px@renesas.com, Magnus Damm Subject: [LTSI-dev] [PATCH] arm: arch_timer: Do not set C3STOP in case CPU_IDLE=n X-BeenThere: ltsi-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "A list to discuss patches, development, and other things related to the LTSI project" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ltsi-dev-bounces@lists.linuxfoundation.org Errors-To: ltsi-dev-bounces@lists.linuxfoundation.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm Modify the ARM architected timer driver to not set C3STOP in case CPU_IDLE is disabled. This is a short term fix that allows use of high resolution timers even though no additional clock event is registered. Signed-off-by: Magnus Damm --- This patch is not for upstream merge nor merge into LTSI-3.4, instead it is expected that it will be included into the git repository renesas-backports at kernel.org. When upstream decides to merge a solution to this problem then this patch will be replaced with the upstream solution. drivers/clocksource/arm_arch_timer.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) --- 0001/drivers/clocksource/arm_arch_timer.c +++ work/drivers/clocksource/arm_arch_timer.c 2013-06-17 09:03:44.000000000 +0900 @@ -125,7 +125,23 @@ static int arch_timer_set_next_event_phy static int __cpuinit arch_timer_setup(struct clock_event_device *clk) { - clk->features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_C3STOP; + clk->features = CLOCK_EVT_FEAT_ONESHOT; +#ifdef CONFIG_CPU_IDLE + /* By not setting the C3STOP flag it is possible to let the + * ARM architected timer to be the only clock event installed + * on the system and have working high resolution timers. + * + * If the C3STOP flag is set unconditionally then the kernel + * will always prevent using the high resoultion timer feature + * unless an additional clock event is registered. + * + * In the case where CPU_IDLE is enabled then there is a chance + * that deeper sleep states will be handled by software, but + * if CPU_IDLE is disabled then deep sleep states cannot be + * entered and the feature flagged by C3STOP is not needed. + */ + clk->features |= CLOCK_EVT_FEAT_C3STOP; +#endif clk->name = "arch_sys_timer"; clk->rating = 450; if (arch_timer_use_virtual) {