[lkml]   [2020]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCHv2-next 0/3] serial/sysrq: Add MAGIC_SYSRQ_SERIAL_SEQUENCE
Magic sysrq has proven for Arista usecases to be useful for debugging issues in field, over serial line when the switch is in such bad state
that it can't accept network connections anymore.

Unfortunately, having sysrq always enabled doesn't work for some
embedded boards that tend to generate garbage on serial line (including
BREAKs). Since commit 732dbf3a6104 ("serial: do not accept sysrq
characters via serial port"), it's possible to keep sysrq enabled, but
over serial line.

Add a way to enable sysrq on a uart, where currently it can be
constantly either on or off (CONFIG_MAGIC_SYSRQ_SERIAL).
While doing so, cleanup __sysrq_enabled and serial_core header file.

Sending against -next tree as it's based on removing SUPPORT_SYSRQ
ifdeffery [1].

Changes since v1 [2]:
- Fix typo in pr_info() message (noticed by Randy Dunlap, thanks)
- Add SYSRQ_TIMEOUT define for timeout after BREAK and separate removing
@unused member of uart_port into cleanup patch (by Greg's review, thanks)
- Add const qualifier, make uart_try_toggle_sysrq() bool function
(Joe Perches, thanks)
build failures (kudos to kbuild test robot)


Cc: Greg Kroah-Hartman <>
Cc: Iurii Zaikin <>
Cc: Jiri Slaby <>
Cc: Joe Perches <>
Cc: Randy Dunlap <>
Cc: Vasiliy Khoruzhick <>


Dmitry Safonov (3):
sysctl/sysrq: Remove __sysrq_enabled copy
serial_core: Remove unused member in uart_port

drivers/tty/serial/serial_core.c | 75 +++++++++++++++++++++++++++++---
drivers/tty/sysrq.c | 7 +++
include/linux/serial_core.h | 2 +-
include/linux/sysrq.h | 7 +++
kernel/sysctl.c | 41 +++++++++--------
lib/Kconfig.debug | 8 ++++
6 files changed, 113 insertions(+), 27 deletions(-)


 \ /
  Last update: 2020-01-14 18:20    [W:0.088 / U:25.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site