From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755985AbdBQJbf (ORCPT ); Fri, 17 Feb 2017 04:31:35 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44438 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755263AbdBQJbc (ORCPT ); Fri, 17 Feb 2017 04:31:32 -0500 Subject: Re: [PATCH] powerpc/xmon: Fix an unexpected xmon onoff state change To: Michael Ellerman , "Guilherme G. Piccoli" , Pan Xinhui , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org 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> Cc: benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com From: Pan Xinhui Date: Fri, 17 Feb 2017 17:30:23 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <87h93tjqrn.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17021709-0048-0000-0000-00000206BC1F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17021709-0049-0000-0000-0000478CAE87 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-17_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702170090 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ÔÚ 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. Yes, the behavior changed anyway. Will fix that in v3. > cheers >