From patchwork Mon Jun 17 00:20:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 2729981 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0E8299F472 for ; Mon, 17 Jun 2013 00:21:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 159D5201CC for ; Mon, 17 Jun 2013 00:21:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 04F24201C2 for ; Mon, 17 Jun 2013 00:21:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755443Ab3FQAU7 (ORCPT ); Sun, 16 Jun 2013 20:20:59 -0400 Received: from mail-pb0-f43.google.com ([209.85.160.43]:58898 "EHLO mail-pb0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754621Ab3FQAU6 (ORCPT ); Sun, 16 Jun 2013 20:20:58 -0400 Received: by mail-pb0-f43.google.com with SMTP id md12so2223704pbc.16 for ; Sun, 16 Jun 2013 17:20:58 -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=ZH50LF8l/38jEutlHac8nrIq4++9LCgqNsD9YcE1ka0=; b=g6XXkkBZeUCr8rcy4fCYSccQDumUp8CrLOx7AqMDbM0yRkWwtlWbKZS5NLZLrIrQ09 1YDShw/N5RBu9iBuEB8QWzY/7qXEvKLJIa1/z7t1GAHhkTEnvXfMjv/iXtFHBnYQsXqV DDwe6nUwYKPFjwHlGkYeI2syz/BpNC8MhU+aObuau6MTZQ41tmfxWC36M/RgT7LkffBP 7IMB1z/r9AJD1hgcVMYAHu9D5OfQ/0FlrsBGX3XSwUEK1f0Qwf3Q9qgyD3+GNGVlbyld D1bJWAMtiXgYSHWx4cB9BxiBc7AsAtkJKha5IkAp64MgmW4rd796WQMCZCVUpwnf0Dpd mmmg== X-Received: by 10.68.134.103 with SMTP id pj7mr3596209pbb.171.1371428458343; Sun, 16 Jun 2013 17:20:58 -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 tq3sm3119489pab.7.2013.06.16.17.20.54 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Jun 2013 17:20:56 -0700 (PDT) From: Magnus Damm To: linux-kernel@vger.kernel.org Cc: mark.rutland@arm.com, linux-sh@vger.kernel.org, marc.zyngier@arm.com, catalin.marinas@arm.com, horms@verge.net.au, john.stultz@linaro.org, shinya.kuribayashi.px@renesas.com, Magnus Damm , tglx@linutronix.de Date: Mon, 17 Jun 2013 09:20:56 +0900 Message-Id: <20130617002056.7646.54131.sendpatchset@w520> Subject: [PATCH/RFC] arm: arch_timer: Do not set C3STOP in case CPU_IDLE=n Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 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. Not-really-Signed-off-by: Magnus Damm --- If someone cares about this case then perhaps it should be moved up to the clock event main code. The same issue should in theory trigger on all architectures, perhaps x86 people hunting for low latency may try to disable CPU_IDLE? I propose carrying this patch locally to enable high resolution timers until CPU_IDLE and an additional clock event is supported. Observed on r8a73a4 and APE6EVM. drivers/clocksource/arm_arch_timer.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 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) {