From patchwork Thu May 21 12:35:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mason X-Patchwork-Id: 6454721 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 BA0FFC0432 for ; Thu, 21 May 2015 12:38:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DA427202A1 for ; Thu, 21 May 2015 12:38:22 +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 C405120304 for ; Thu, 21 May 2015 12:38:20 +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 1YvPi6-00032o-DE; Thu, 21 May 2015 12:36:26 +0000 Received: from smtp2-g21.free.fr ([212.27.42.2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YvPi0-0002ty-FZ for linux-arm-kernel@lists.infradead.org; Thu, 21 May 2015 12:36:21 +0000 Received: from [172.27.0.114] (unknown [83.142.147.193]) (Authenticated sender: shill) by smtp2-g21.free.fr (Postfix) with ESMTPSA id 89D0A4B0294; Thu, 21 May 2015 14:34:21 +0200 (CEST) Message-ID: <555DD11E.7080302@free.fr> Date: Thu, 21 May 2015 14:35:42 +0200 From: Mason User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0 SeaMonkey/2.32.1 MIME-Version: 1.0 To: Arnd Bergmann Subject: Re: schedule_timeout sleeps too long after dividing CPU frequency References: <20150514144239.GZ2067@n2100.arm.linux.org.uk> <76003699.Oyq777txnm@wuerfel> <555D030F.8030100@free.fr> <2681862.SyQNaSxams@wuerfel> In-Reply-To: <2681862.SyQNaSxams@wuerfel> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150521_053620_675472_05A9C983 X-CRM114-Status: GOOD ( 15.08 ) X-Spam-Score: -0.7 (/) Cc: Mans Rullgard , Russell King - ARM Linux , Marc Zyngier , Viresh Kumar , Linus Walleij , Daniel Lezcano , Will Deacon , John Stultz , Catalin Marinas , Thomas Gleixner , Linux ARM 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,FREEMAIL_FROM, 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 On 21/05/2015 00:18, Arnd Bergmann wrote: > On Wednesday 20 May 2015 23:56:31 Mason wrote: > >> Or perhaps the other way around? >> i.e. feat_c3stop initialized to 0 (thus in the bss section) >> and set to FEAT_C3STOP if "twd_never_stops" doesn't exist... > > yes. IIUC, something along these lines: >> Russell, when you added the FEAT_C3STOP flag unconditionally in >> commit 5388a6b266, didn't that potentially break platforms that >> didn't expect the flag to be set? > > To take a step back, you should first figure out whether clearing > this flag is actually the correct behavior for your hardware, or > just happens to work by accident. According to my (limited) understanding of the clockevents core, a "broadcast device" is required if and only if the local timers have CLOCK_EVT_FEAT_C3STOP. I could be wrong. Additional reference: https://lwn.net/Articles/574962/ Regards. diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index 172c6a05..e10a388 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c @@ -34,6 +34,7 @@ static unsigned long twd_timer_rate; static DEFINE_PER_CPU(bool, percpu_setup_called); static struct clock_event_device __percpu *twd_evt; +static int feat_c3stop; static int twd_ppi; static void twd_set_mode(enum clock_event_mode mode, @@ -294,7 +295,7 @@ static void twd_timer_setup(void) clk->name = "local_timer"; clk->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT | - CLOCK_EVT_FEAT_C3STOP; + feat_c3stop; clk->rating = 350; clk->set_mode = twd_set_mode; clk->set_next_event = twd_set_next_event; @@ -346,6 +347,8 @@ static int __init twd_local_timer_common_register(struct device_node *np) goto out_irq; twd_get_clock(np); + if (!of_property_read_bool(np, "twd_never_stops")) + feat_c3stop = CLOCK_EVT_FEAT_C3STOP; /* * Immediately configure the timer on the boot CPU, unless we need