Skip to content

serial/sysrq: Add MAGIC_SYSRQ_SERIAL_SEQUENCE

Dmitry Safonov linux-fsdevel linux-serial lkml oe-kbuild-all 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 5 repliesIn review
  2. v13 patches 12 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2sysctl/sysrq: Remove __sysrq_enabled copydrivers/tty/sysrq.c include/linux/sysrq.h kernel/sysctl.c+41 -192 replies
2/2serial/sysrq: Add MAGIC_SYSRQ_SERIAL_SEQUENCEdrivers/tty/serial/serial_core.c include/linux/serial_core.h lib/Kconfig.debug+77 -73 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchVasiliy Khoruzhick
1/2
2/2Based-on-patch-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCHv3 0/2] 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.

Changes since v2 [2]:
- sysrq_get_mask() renamed to sysrq_mask() as there isn't sysrq_put_mask(); acquired kernel-doc (by Greg's review, thanks)
- uart_try_toggle_sysrq() now returns true/false instead 1/0 as it's a bool function (nits by Joe Perches, thanks!)
- Dropped "sizeof(port->sysrq_seq)*U8_MAX" and used U8_MAX (Randy Dunlap)

Changes since v1 [1]:
- 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)
- Fix !CONFIG_SYSRQ and CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE="" build failures (kudos to kbuild test robot)

[1]: https://lkml.kernel.org/r/[email protected]
[2]: https://lkml.kernel.org/r/[email protected]

Cc Greg Kroah-Hartman <[email protected]>
Cc Iurii Zaikin <[email protected]>
Cc Jiri Slaby <[email protected]>
Cc Joe Perches <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc Vasiliy Khoruzhick <[email protected]>

Thanks,
Dmitry

Dmitry Safonov (2):
sysctl/sysrq: Remove __sysrq_enabled copy
serial/sysrq: Add MAGIC_SYSRQ_SERIAL_SEQUENCE

 drivers/tty/serial/serial_core.c | 75 +++++++++++++++++++++++++++++---
 drivers/tty/sysrq.c              | 12 +++++
 include/linux/serial_core.h      |  1 +
 include/linux/sysrq.h            |  7 +++
 kernel/sysctl.c                  | 41 +++++++++--------
 lib/Kconfig.debug                |  8 ++++
 6 files changed, 118 insertions(+), 26 deletions(-)
Signature · 1 line
2.25.0