From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752201AbdBTEqQ convert rfc822-to-8bit (ORCPT ); Sun, 19 Feb 2017 23:46:16 -0500 Received: from ozlabs.org ([103.22.144.67]:43767 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751935AbdBTEqP (ORCPT ); Sun, 19 Feb 2017 23:46:15 -0500 From: Michael Ellerman To: Pan Xinhui , "Guilherme G. Piccoli" , Pan Xinhui , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com Subject: Re: [PATCH] powerpc/xmon: Fix an unexpected xmon onoff state change In-Reply-To: References: <1487144990-5969-1-git-send-email-xinhui.pan@linux.vnet.ibm.com> <87shnek9hd.fsf@concordia.ellerman.id.au> <72cfff06-bd93-a727-0b93-31dfa3a7ac65@linux.vnet.ibm.com> <8466dffc-d75c-d83a-2a4f-d567721db7d5@linux.vnet.ibm.com> <87h93tjqrn.fsf@concordia.ellerman.id.au> User-Agent: Notmuch/0.21 (https://notmuchmail.org) Date: Mon, 20 Feb 2017 15:46:13 +1100 Message-ID: <87tw7ph3l6.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pan Xinhui writes: > 在 2017/2/17 14:05, Michael Ellerman 写道: >> Pan Xinhui writes: >>> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c >>> index 9c0e17c..f6e5c3d 100644 >>> --- a/arch/powerpc/xmon/xmon.c >>> +++ b/arch/powerpc/xmon/xmon.c >>> @@ -76,6 +76,7 @@ static int xmon_gate; >>> #endif /* CONFIG_SMP */ >>> >>> static unsigned long in_xmon __read_mostly = 0; >>> +static int xmon_off = !IS_ENABLED(CONFIG_XMON_DEFAULT); >> >> I think the logic would probably clearer if we invert this to become >> xmon_on. >> > yep, make sense. > >>> @@ -3266,16 +3269,16 @@ static int __init setup_xmon_sysrq(void) >>> __initcall(setup_xmon_sysrq); >>> #endif /* CONFIG_MAGIC_SYSRQ */ >>> >>> -static int __initdata xmon_early, xmon_off; >>> +static int __initdata xmon_early; >>> >>> static int __init early_parse_xmon(char *p) >>> { >>> if (!p || strncmp(p, "early", 5) == 0) { >>> /* just "xmon" is equivalent to "xmon=early" */ >>> - xmon_init(1); >>> xmon_early = 1; >>> + xmon_off = 0; >>> } else if (strncmp(p, "on", 2) == 0) >>> - xmon_init(1); >>> + xmon_off = 0; >> >> You've just changed the timing of when xmon gets enabled for the above >> two cases, from here which is called very early, to xmon_setup() which >> is called much later in boot. >> >> That effectively disables xmon for most of the boot, which we do not >> want to do. >> > Although it is not often that kernel got stucked during boot. I hope you're joking! :) cheers