From patchwork Sat Aug 25 10:33:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 179963 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B15A42C00F6 for ; Sat, 25 Aug 2012 20:33:28 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750931Ab2HYKcS (ORCPT ); Sat, 25 Aug 2012 06:32:18 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:34134 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750837Ab2HYKcR (ORCPT ); Sat, 25 Aug 2012 06:32:17 -0400 Received: by dady13 with SMTP id y13so1451416dad.19 for ; Sat, 25 Aug 2012 03:32:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent :x-gm-message-state; bh=Jy0t+gt8lFuCG3mATE9cQQ3D4Fr42bdqr4oiRwKereI=; b=XKsjAQ5cMav+Zs+iutnXHYNZ0ed2krUm6jKL2OlJQx4397yUGukop0aH2UCeLIo6xr f0zxTplkAzfSzaytELAgiLp7bDUYFMIuJ/AoUi5SI9IgefpTNppeWqDul4RWVWMKbAEm DXkBCaqbkmciyYyYZjf+3CgU7Er6WZ3x/gejOi5Rk5ve50BV0Sq5RQ/1HVFAC2EmMBKs CZ78v/0DLYoW/+ZeGzQwTKz7/vMVUVMJFxfE1yyszi/1mIXCjiKTOlw9o5YyWYOGU7Gb iuEs8LvKw93KdQflVOHgfpKn9BDeCzRQoFULBe1BMHsLhnL3ofnVrrIFXtfSl++JOpir yqrQ== Received: by 10.66.87.2 with SMTP id t2mr7967356paz.6.1345890736332; Sat, 25 Aug 2012 03:32:16 -0700 (PDT) Received: from S2101-09.ap.freescale.net ([114.216.151.182]) by mx.google.com with ESMTPS id hc10sm3357638pbc.21.2012.08.25.03.32.13 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 25 Aug 2012 03:32:15 -0700 (PDT) Date: Sat, 25 Aug 2012 18:33:01 +0800 From: Shawn Guo To: Russell King - ARM Linux Cc: Bill Huang , "'linux-tegra@vger.kernel.org'" , "'linux-kernel@vger.kernel.org'" , "'linux-arm-kernel@lists.infradead.org'" Subject: Re: Shutdown problem in SMP system happened on Tegra20 Message-ID: <20120825103257.GN31998@S2101-09.ap.freescale.net> References: <20120824182133.GB18957@n2100.arm.linux.org.uk> <20120825073624.GI31998@S2101-09.ap.freescale.net> <20120825075221.GH18957@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120825075221.GH18957@n2100.arm.linux.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQnXwtSMLzGwh7vgqn84Rigr/0F3S30wLu2uNveXXAT3MZBVQXLTkEswIFnR+G6p32lrSHrG Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org On Sat, Aug 25, 2012 at 08:52:21AM +0100, Russell King - ARM Linux wrote: > On Sat, Aug 25, 2012 at 03:36:27PM +0800, Shawn Guo wrote: > > On Fri, Aug 24, 2012 at 07:21:33PM +0100, Russell King - ARM Linux wrote: > > > Why not just ensure that CONFIG_PM_SLEEP_SMP is enabled if your platform > > > requires that the lowest CPU number be the CPU dealing with reboot? > > > > I have CONFIG_PM_SLEEP_SMP enabled for imx6q, but still see the imx6q > > restart hook running on cpu1 than cpu0. It seems that > > disable_nonboot_cpus is only called in kernel_power_off but never > > kernel_restart. We should probably patch kernel_restart or > > machine_restart to have disable_nonboot_cpus called? > > Remember that this path gets called from IRQ context which makes calling > functions which sleep very dodgy. I'm so familiar with the code/context. Are you saying disable_nonboot_cpus sleeps and kernel_power_off never gets called from IRQ context? I tested the code change below on kernel_restart with CONFIG_DEBUG_ATOMIC_SLEEP enabled. It fixes imx6q restart issue (with no change on cpu_relax) while no sleep-inside-atomic-section warning is seen. Regards, Shawn --- To unsubscribe from this list: send the line "unsubscribe linux-tegra" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/kernel/sys.c b/kernel/sys.c index 241507f..0359328 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -373,6 +373,7 @@ void kernel_restart(char *cmd) else printk(KERN_EMERG "Restarting system with command '%s'.\n", cmd); kmsg_dump(KMSG_DUMP_RESTART); + disable_nonboot_cpus(); machine_restart(cmd); } EXPORT_SYMBOL_GPL(kernel_restart);