Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756711AbXI1Tx3 (ORCPT ); Fri, 28 Sep 2007 15:53:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752624AbXI1TxX (ORCPT ); Fri, 28 Sep 2007 15:53:23 -0400 Received: from rtr.ca ([76.10.145.34]:3586 "EHLO mail.rtr.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752269AbXI1TxW (ORCPT ); Fri, 28 Sep 2007 15:53:22 -0400 Message-ID: <46FD5BAF.8040304@rtr.ca> Date: Fri, 28 Sep 2007 15:53:19 -0400 From: Mark Lord User-Agent: Thunderbird 2.0.0.6 (X11/20070728) MIME-Version: 1.0 To: Thomas Gleixner Cc: "Rafael J. Wysocki" , Len Brown , Linux Kernel , simon.derr@bull.net, Andrew Morton Subject: [PATCH] (repost) Fix SMP poweroff hangs References: <46FC20B7.4000606@rtr.ca> <200709281455.29069.rjw@sisk.pl> <46FD001A.3070309@rtr.ca> <200709281544.30497.rjw@sisk.pl> <46FD05B8.2040302@rtr.ca> <46FD0724.5060009@rtr.ca> <1190991316.18681.38.camel@chaos> In-Reply-To: <1190991316.18681.38.camel@chaos> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1419 Lines: 48 Rafael J. Wysocki wrote: > .. >> @@ -879,6 +880,7 @@ >> if (pm_power_off_prepare) >> pm_power_off_prepare(); >> sysdev_shutdown(); >> + disable_nonboot_cpus(); > > Before sysdev_shutdown(), please. > > sysdev_shutdown() may touch things that belong to CPU0. Thanks. Here is the revised patch. * * * We need to disable all CPUs other than the boot CPU (usually 0) before attempting to power-off modern SMP machines. This fixes the hang-on-poweroff issue on my MythTV SMP box, and also on Thomas Gleixner's new toybox. Signed-off-by: Mark Lord Acked-by: Thomas Gleixner --- --- linux/kernel/sys.c.orig 2007-09-13 09:49:11.000000000 -0400 +++ linux/kernel/sys.c 2007-09-28 15:48:54.000000000 -0400 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -878,6 +879,7 @@ kernel_shutdown_prepare(SYSTEM_POWER_OFF); if (pm_power_off_prepare) pm_power_off_prepare(); + disable_nonboot_cpus(); sysdev_shutdown(); printk(KERN_EMERG "Power down.\n"); machine_power_off(); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/