From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753776AbdBPK57 (ORCPT ); Thu, 16 Feb 2017 05:57:59 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:38422 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751191AbdBPK56 (ORCPT ); Thu, 16 Feb 2017 05:57:58 -0500 Subject: Re: [PATCH] powerpc/xmon: Fix an unexpected xmon onoff state change To: Michael Ellerman , 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> Cc: benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com From: "Guilherme G. Piccoli" Date: Thu, 16 Feb 2017 08:57:50 -0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <87shnek9hd.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17021610-0024-0000-0000-000001544065 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17021610-0025-0000-0000-00001619428D Message-Id: <72cfff06-bd93-a727-0b93-31dfa3a7ac65@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-16_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702160110 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/02/2017 03:09, Michael Ellerman wrote: > Pan Xinhui writes: > >> Once xmon is triggered by sysrq-x, it is enabled always afterwards even >> if it is disabled during boot. This will cause a system reset interrut >> fail to dump. So keep xmon in its original state after exit. >> >> Signed-off-by: Pan Xinhui >> --- >> arch/powerpc/xmon/xmon.c | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c >> index 9c0e17c..721212f 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 = 0; >> >> static unsigned long adrs; >> static int size = 1; >> @@ -3250,6 +3251,8 @@ static void sysrq_handle_xmon(int key) >> /* ensure xmon is enabled */ >> xmon_init(1); >> debugger(get_irq_regs()); >> + if (xmon_off) >> + xmon_init(0); >> } > > I don't think this is right. > > xmon_off is only true if you boot with xmon=off on the command line. > > So if you boot with CONFIG_XMON_DEFAULT=n, and nothing on the command > line, then enter xmon via sysrq, then exit, xmon will still be enabled. > Agreed, noticed it after some work in V2 of my patch. I'm addressing it there, so maybe no harm in keeping this way here.. Thanks, Guilherme > cheers >