From patchwork Sun Dec 30 16:15:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1919721 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 3D31D402E1 for ; Sun, 30 Dec 2012 16:19:01 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TpLYe-0005EB-G3; Sun, 30 Dec 2012 16:16:16 +0000 Received: from mail-ob0-f170.google.com ([209.85.214.170]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TpLXs-00056T-SX for linux-arm-kernel@lists.infradead.org; Sun, 30 Dec 2012 16:15:30 +0000 Received: by mail-ob0-f170.google.com with SMTP id wp18so11084064obc.1 for ; Sun, 30 Dec 2012 08:15:27 -0800 (PST) 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:in-reply-to :references; bh=facIkwl27qBO8Bln+Sr6JPizvNZsi/EjhWe9HtzkFyg=; b=UYRCv3LBTeMt5w2GQLyDS7UyvQTtJh31hRmYcSkjC8ofNtN356YPLO7A25wNsrnwjR yHWZe60JcD6vdH/IxIp1RtaLEbbYwDNT2/IaBfLgJ05fBMi0ut3zpzowL6LH5XxdHVNM XaeQ9ZXvXlugW2rTDW/HldHg23aCzbMuud0UmSXFpC/xUYoVtnD3XXRsynAXJxQNSvaO Ck9svHkabnt3DBwasSHKRv4MSWyno7X9u45k7vJfgNgvDXJjXq3gev2l6rdpFIR2vk+u g47/qrK8l+u6s6TubjS4bSGH7jhEs+iVY35wpAiAUeWvG0Q0MM3oc53UhqA1WPGEl1Ml u11g== X-Received: by 10.182.48.69 with SMTP id j5mr31813487obn.17.1356884127789; Sun, 30 Dec 2012 08:15:27 -0800 (PST) Received: from rob-laptop.grandenetworks.net (65-36-73-129.dyn.grandenetworks.net. [65.36.73.129]) by mx.google.com with ESMTPS id n7sm27480426obd.16.2012.12.30.08.15.26 (version=SSLv3 cipher=OTHER); Sun, 30 Dec 2012 08:15:27 -0800 (PST) From: Rob Herring To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/6] ARM: highbank: fix secondary boot and hotplug Date: Sun, 30 Dec 2012 10:15:05 -0600 Message-Id: <1356884107-30991-5-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1356884107-30991-1-git-send-email-robherring2@gmail.com> References: <1356884107-30991-1-git-send-email-robherring2@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121230_111529_036034_3C993BEB X-CRM114-Status: GOOD ( 14.55 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.170 listed in list.dnswl.org] 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: Olof Johansson , Nicolas Pitre , Rob Herring , Mark Langsdorf , Arnd Bergmann X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Rob Herring With commit 384a290 (ARM: gic: use a private mapping for CPU target interfaces), wake-up IPIs now go to all cores as the gic cpu interface numbering may not follow core numbering. This broke secondary boot on highbank since the boot address was already set for all secondary cores, this caused all cores to boot before the kernel was ready. Fix this by moving the setting of the jump address to highbank_boot_secondary instead of highbank_smp_prepare_cpus and highbank_cpu_die. Also, clear the address when we boot. This prevents cores from booting before they are actually triggered and is also necessary to get suspend/resume to work. Signed-off-by: Rob Herring Cc: Nicolas Pitre --- arch/arm/mach-highbank/hotplug.c | 2 +- arch/arm/mach-highbank/platsmp.c | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-highbank/hotplug.c b/arch/arm/mach-highbank/hotplug.c index 7b60fac..f30c528 100644 --- a/arch/arm/mach-highbank/hotplug.c +++ b/arch/arm/mach-highbank/hotplug.c @@ -30,7 +30,7 @@ void __ref highbank_cpu_die(unsigned int cpu) { flush_cache_all(); - highbank_set_cpu_jump(cpu, secondary_startup); + highbank_set_cpu_jump(cpu, phys_to_virt(0)); highbank_set_core_pwr(); cpu_do_idle(); diff --git a/arch/arm/mach-highbank/platsmp.c b/arch/arm/mach-highbank/platsmp.c index 1129957..4ecc864 100644 --- a/arch/arm/mach-highbank/platsmp.c +++ b/arch/arm/mach-highbank/platsmp.c @@ -32,6 +32,7 @@ static void __cpuinit highbank_secondary_init(unsigned int cpu) static int __cpuinit highbank_boot_secondary(unsigned int cpu, struct task_struct *idle) { + highbank_set_cpu_jump(cpu, secondary_startup); gic_raise_softirq(cpumask_of(cpu), 0); return 0; } @@ -61,19 +62,8 @@ static void __init highbank_smp_init_cpus(void) static void __init highbank_smp_prepare_cpus(unsigned int max_cpus) { - int i; - if (scu_base_addr) scu_enable(scu_base_addr); - - /* - * Write the address of secondary startup into the jump table - * The cores are in wfi and wait until they receive a soft interrupt - * and a non-zero value to jump to. Then the secondary CPU branches - * to this address. - */ - for (i = 1; i < max_cpus; i++) - highbank_set_cpu_jump(i, secondary_startup); } struct smp_operations highbank_smp_ops __initdata = {