890-uart_optional_sysrq.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From: John Crispin <[email protected]>
  2. Subject: serial: do not accept sysrq characters via serial port
  3. many embedded boards have a disconnected TTL level serial which can
  4. generate some garbage that can lead to spurious false sysrq detects.
  5. [[email protected]: sent upstream 22.12.2016]
  6. Signed-off-by: John Crispin <[email protected]>
  7. Signed-off-by: Felix Fietkau <[email protected]>
  8. ---
  9. include/linux/serial_core.h | 2 +-
  10. lib/Kconfig.debug | 5 +++++
  11. 2 files changed, 6 insertions(+), 1 deletion(-)
  12. --- a/include/linux/serial_core.h
  13. +++ b/include/linux/serial_core.h
  14. @@ -455,7 +455,7 @@ extern void uart_handle_cts_change(struc
  15. extern void uart_insert_char(struct uart_port *port, unsigned int status,
  16. unsigned int overrun, unsigned int ch, unsigned int flag);
  17. -#ifdef SUPPORT_SYSRQ
  18. +#if defined(SUPPORT_SYSRQ) && defined(CONFIG_MAGIC_SYSRQ_SERIAL)
  19. static inline int
  20. uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)
  21. {
  22. --- a/lib/Kconfig.debug
  23. +++ b/lib/Kconfig.debug
  24. @@ -410,6 +410,11 @@ config MAGIC_SYSRQ_DEFAULT_ENABLE
  25. This may be set to 1 or 0 to enable or disable them all, or
  26. to a bitmask as described in Documentation/sysrq.txt.
  27. +config MAGIC_SYSRQ_SERIAL
  28. + bool "Enable magic SysRq key over serial"
  29. + depends on MAGIC_SYSRQ
  30. + default y
  31. +
  32. config DEBUG_KERNEL
  33. bool "Kernel debugging"
  34. help