From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755550AbdBQGF6 (ORCPT ); Fri, 17 Feb 2017 01:05:58 -0500 Received: from ozlabs.org ([103.22.144.67]:49927 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751110AbdBQGF5 (ORCPT ); Fri, 17 Feb 2017 01:05:57 -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: <8466dffc-d75c-d83a-2a4f-d567721db7d5@linux.vnet.ibm.com> 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> User-Agent: Notmuch/0.21 (https://notmuchmail.org) Date: Fri, 17 Feb 2017 17:05:48 +1100 Message-ID: <87h93tjqrn.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > @@ -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. cheers