From patchwork Wed Apr 17 15:46:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 2454311 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id B38183FC64 for ; Wed, 17 Apr 2013 15:47:12 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1USUZi-0002lk-JV; Wed, 17 Apr 2013 15:47:10 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1USUZg-00083c-7X; Wed, 17 Apr 2013 15:47:08 +0000 Received: from mail-qc0-x22c.google.com ([2607:f8b0:400d:c01::22c]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1USUZd-00083J-Ib for linux-arm-kernel@lists.infradead.org; Wed, 17 Apr 2013 15:47:06 +0000 Received: by mail-qc0-f172.google.com with SMTP id b25so96205qca.17 for ; Wed, 17 Apr 2013 08:47:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=9NhmuohDoFX1P5a5E8Ukv04QgwaHdaYsTslz74Hl1II=; b=Zem37xHbqIsReVlyhFHBF83BV2pXru2T2AtRDPuLhDJQGGpYS25iWKWdxtQOxjBzJQ i/F+Ta4JVyOHTIWGC+YDlKgpAB+rgbC+aoJDrgl6ktJjX1VN6Ya4kLvTrCcf+eB4T7LK 5ee+JymTGs8TAnkyrTs1hqs5HzBYaAME9ukx3wEdMjYEqjDg7gdOa/LEjbTiqcmvdUHs 3nvF16AspeHcYWP+35JvzAeNer6mwQx/6SNhpaz2UzpZfHjH4sETcS5mdA2iAhwX9Os/ SO2sPPhbKfKMmayfibr7NdYFa5NYEQaUgal9ImQZ4zn4Hpfv4dGpioncXplM4a/nesLa SCsQ== X-Received: by 10.224.40.10 with SMTP id i10mr7099197qae.96.1366213622087; Wed, 17 Apr 2013 08:47:02 -0700 (PDT) Received: from rob-laptop.calxeda.com ([173.226.190.126]) by mx.google.com with ESMTPS id bv6sm7680749qab.5.2013.04.17.08.47.01 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Apr 2013 08:47:01 -0700 (PDT) From: Rob Herring To: linux-arm-kernel@lists.infradead.org, arm@kernel.org Subject: [PATCH] ARM: highbank: fix cache flush ordering for cpu hotplug Date: Wed, 17 Apr 2013 10:46:52 -0500 Message-Id: <1366213612-13526-1-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130417_114705_723189_FD3F36D4 X-CRM114-Status: UNSURE ( 9.87 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (robherring2[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (robherring2[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Tim Gardner , Rob Herring 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 From: Rob Herring The L1 data cache flush needs to be after highbank_set_cpu_jump call which pollutes the cache with the l2x0_lock. This causes other cores to deadlock waiting for the l2x0_lock. Moving the flush of the entire data cache after highbank_set_cpu_jump fixes the problem. Use flush_cache_louis instead of flush_cache_all are that is sufficient to flush only the L1 data cache. flush_cache_louis did not exist when highbank_cpu_die was originally written. With PL310 errata 769419 enabled, a wmb is inserted into idle which takes the l2x0_lock. This makes the problem much more easily hit and causes reset to hang. Reported-by: Paolo Pisati Signed-off-by: Rob Herring --- Olof, Arnd, If you have any more 3.9 fixes, please send this in. Otherwise, it can wait for 3.10 and mark for stable. Rob arch/arm/mach-highbank/hotplug.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-highbank/hotplug.c b/arch/arm/mach-highbank/hotplug.c index f30c528..890cae2 100644 --- a/arch/arm/mach-highbank/hotplug.c +++ b/arch/arm/mach-highbank/hotplug.c @@ -28,13 +28,11 @@ extern void secondary_startup(void); */ void __ref highbank_cpu_die(unsigned int cpu) { - flush_cache_all(); - highbank_set_cpu_jump(cpu, phys_to_virt(0)); - highbank_set_core_pwr(); - cpu_do_idle(); + flush_cache_louis(); + highbank_set_core_pwr(); - /* We should never return from idle */ - panic("highbank: cpu %d unexpectedly exit from shutdown\n", cpu); + while (1) + cpu_do_idle(); }