From patchwork Tue Feb 11 00:44:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 3624371 Return-Path: X-Original-To: patchwork-linux-arm@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 E08AA9F2F6 for ; Tue, 11 Feb 2014 00:50:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB23E201F4 for ; Tue, 11 Feb 2014 00:50:45 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (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 CAD14201F5 for ; Tue, 11 Feb 2014 00:50:44 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WD1YI-0004KB-4g; Tue, 11 Feb 2014 00:50:18 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WD1TQ-0003M1-Bb; Tue, 11 Feb 2014 00:45:16 +0000 Received: from mail.kmu-office.ch ([178.209.48.102]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WD1TF-0003L1-VW for linux-arm-kernel@lists.infradead.org; Tue, 11 Feb 2014 00:45:10 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.kmu-office.ch (Postfix) with ESMTP id AA6864022FF for ; Tue, 11 Feb 2014 01:42:25 +0100 (CET) X-Virus-Scanned: by amavisd-new at kmu-office.ch Received: from mail.kmu-office.ch ([127.0.0.1]) by localhost (mail.kmu-office.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1H0zxKBlVUkX for ; Tue, 11 Feb 2014 01:42:25 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.kmu-office.ch (Postfix) with ESMTP id 7B048402703 for ; Tue, 11 Feb 2014 01:42:25 +0100 (CET) Received: from luegisland.agner.local (62-12-233-187.pool.cyberlink.ch [62.12.233.187]) (Authenticated sender: stefan@agner.ch) by mail.kmu-office.ch (Postfix) with ESMTPSA id EFDBB4022FF; Tue, 11 Feb 2014 01:42:24 +0100 (CET) From: Stefan Agner To: swarren@wwwdotorg.org, thierry.reding@gmail.com, josephl@nvidia.com Subject: [PATCH] ARM: tegra: don't timeout if CPU is powergated Date: Tue, 11 Feb 2014 01:44:13 +0100 Message-Id: <1d5ea6b7df4573d866779857922ac650fe59af60.1392078805.git.stefan@agner.ch> X-Mailer: git-send-email 1.8.5.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140210_194506_120219_DF3C575F X-CRM114-Status: GOOD ( 10.64 ) X-Spam-Score: -1.9 (-) Cc: linux-tegra@vger.kernel.org, Stefan Agner , dev@lynxeye.de, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 When booting secondary CPU(s) which are not yet powergated, a wrong check lead to a timeout after 100 jiffies. With this patch, we only delay powergating if CPUs are still not powered yet. Signed-off-by: Stefan Agner Reviewed-by: Thierry Reding --- I happend to come accross this while working on Colibri T30 support. Obviously, the downstream U-Boot doesn't powergate all CPUs, so the Linux kernel always timed out when booting CPU 1 through 3... arch/arm/mach-tegra/platsmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c index eb72ae7..929d104 100644 --- a/arch/arm/mach-tegra/platsmp.c +++ b/arch/arm/mach-tegra/platsmp.c @@ -114,7 +114,7 @@ static int tegra30_boot_secondary(unsigned int cpu, struct task_struct *idle) /* Wait for the power to come up. */ timeout = jiffies + msecs_to_jiffies(100); - while (tegra_pmc_cpu_is_powered(cpu)) { + while (!tegra_pmc_cpu_is_powered(cpu)) { if (time_after(jiffies, timeout)) return -ETIMEDOUT; udelay(10);