From patchwork Thu Jun 13 01:58:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 2713281 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 859959F1E2 for ; Thu, 13 Jun 2013 02:56:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AF712201EC for ; Thu, 13 Jun 2013 02:56:35 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8EE7D201B9 for ; Thu, 13 Jun 2013 02:56:34 +0000 (UTC) Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Umwp0-0004yz-KH; Thu, 13 Jun 2013 01:59:30 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Umwoq-0005ep-4x; Thu, 13 Jun 2013 01:59:20 +0000 Received: from mail-vc0-f175.google.com ([209.85.220.175]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Umwon-0005de-2j for linux-arm-kernel@lists.infradead.org; Thu, 13 Jun 2013 01:59:18 +0000 Received: by mail-vc0-f175.google.com with SMTP id hr11so6661210vcb.20 for ; Wed, 12 Jun 2013 18:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=GWjyhqi7ryFJ+44O6YRC7BLXneJqwikxPnKK1AHG9c4=; b=d8eqXAQPzNMknnpz/nnZtYFwguMOIIYHXMLdkYtsPN7hUxsKAGbd3GGrdUMema5QV+ YjlXjxUuHivomJBQKrJNtwpU1NC3nmjvb8qwe0mZYlUqWfTB2BnIHA8xkIF3QR6j4D6u lyD0TNAM/7XjDTrfMEFeQ4CsJIA9y5riXnhgv/OBN3GfLEhxNgiZo+JiUp1MG7Zd7vlH M7MsswO2gsooEQ2oay+HkVhWWfId/rqVeCdnpUdqR+h1cpLRry/kYyJ1n+d70rN6Ui5v aByEgHM0ISnxfFH+U+AVp/aQL59fdo84XrGIaLx3Fzl8hC5HZ1A2dtOM8c/BPY+znGNI 7ISg== MIME-Version: 1.0 X-Received: by 10.52.155.67 with SMTP id vu3mr9137639vdb.94.1371088734482; Wed, 12 Jun 2013 18:58:54 -0700 (PDT) Received: by 10.58.238.67 with HTTP; Wed, 12 Jun 2013 18:58:54 -0700 (PDT) In-Reply-To: <1371067281-655-2-git-send-email-swarren@wwwdotorg.org> References: <1371067281-655-1-git-send-email-swarren@wwwdotorg.org> <1371067281-655-2-git-send-email-swarren@wwwdotorg.org> Date: Thu, 13 Jun 2013 09:58:54 +0800 Message-ID: Subject: Re: [PATCH V2 2/2] ARM: decouple CPU offlining from reboot/shutdown From: zhangfei gao To: Stephen Warren X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130612_215917_169749_A44D028F X-CRM114-Status: GOOD ( 15.95 ) X-Spam-Score: -2.7 (--) Cc: Russell King , Will Deacon , Eric Biederman , josephl@nvidia.com, Stephen Warren , linux-arm-kernel 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: , 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.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Thu, Jun 13, 2013 at 4:01 AM, Stephen Warren wrote: > From: Stephen Warren > > Add comments to machine_shutdown()/halt()/power_off()/restart() that > describe their purpose and/or requirements re: CPUs being active/not. > > In machine_shutdown(), replace the call to smp_send_stop() with a call to > disable_nonboot_cpus(). This completely disables all but one CPU, thus > satisfying the requirement that only a single CPU be active for kexec. > Adjust Kconfig dependencies for this change. > > In machine_halt()/power_off()/restart(), call smp_send_stop() directly, > rather than via machine_shutdown(); these functions don't need to > completely de-activate all CPUs using hotplug, but rather just quiesce > them. > > Remove smp_kill_cpus(), and its call from smp_send_stop(). > smp_kill_cpus() was indirectly calling smp_ops.cpu_kill() without calling > smp_ops.cpu_die() on the target CPUs first. At least some implementations > of smp_ops had issues with this; it caused cpu_kill() to hang on Tegra, > for example. Since smp_send_stop() is only used for shutdown, halt, and > power-off, there is no need to attempt any kind of CPU hotplug here. > Hi, Setphen We also met the issue: fail to reboot system from panic. Solve it by the following change. cpu_die is function kill cpu itself cpu_kill is functoin to check whethe the cpu is dead or not What do you think? Thanks diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index e171a0e..624e97c 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -554,6 +554,9 @@ static void ipi_cpu_stop(unsigned int cpu) local_fiq_disable(); local_irq_disable(); +#ifdef CONFIG_HOTPLUG_CPU + cpu_die(); +#endif while (1) cpu_relax(); }