linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/xmon: Dont register sysrq key when kernel param xmon=off
@ 2018-02-12  8:59 Vaibhav Jain
  2018-02-12 11:12 ` Balbir Singh
  0 siblings, 1 reply; 8+ messages in thread
From: Vaibhav Jain @ 2018-02-12  8:59 UTC (permalink / raw)
  To: linuxppc-dev, linux-kernel
  Cc: Vaibhav Jain, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, Balbir Singh, Nicholas Piggin, Douglas Miller,
	Pan Xinhui

Presently sysrq key for xmon('x') is registered during kernel init
irrespective of the value of kernel param 'xmon'. Thus xmon is enabled
even if 'xmon=off' is passed on the kernel command line.

This minor patch updates setup_xmon_sysrq() to register
'sysrq_xmon_op' only when variable 'xmon_on' is set.

Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
---
 arch/powerpc/xmon/xmon.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 82e1a3ee6e0f..3b995474b102 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -3642,8 +3642,7 @@ static struct sysrq_key_op sysrq_xmon_op = {
 
 static int __init setup_xmon_sysrq(void)
 {
-	register_sysrq_key('x', &sysrq_xmon_op);
-	return 0;
+	return xmon_on ? register_sysrq_key('x', &sysrq_xmon_op) : 0;
 }
 device_initcall(setup_xmon_sysrq);
 #endif /* CONFIG_MAGIC_SYSRQ */
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-02-26 11:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-12  8:59 [PATCH] powerpc/xmon: Dont register sysrq key when kernel param xmon=off Vaibhav Jain
2018-02-12 11:12 ` Balbir Singh
2018-02-12 12:35   ` Vaibhav Jain
2018-02-13 22:01     ` Balbir Singh
2018-02-14 11:40     ` Michael Ellerman
2018-02-15  6:43       ` Vaibhav Jain
2018-02-19  8:36         ` Michael Ellerman
2018-02-26 11:46           ` Vaibhav Jain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).