History

serial/sysrq: Add MAGIC_SYSRQ_SERIAL_SEQUENCE

Many embedded boards have a disconnected TTL level serial which can generate some garbage that can lead to spurious false sysrq detects. Currently, sysrq can be either completely disabled for serial console or always disabled (with CONFIG_MAGIC_SYSRQ_SERIAL), since commit 732dbf3a6104 ("serial: do not accept sysrq characters via serial port") At Arista, we have such boards that can generate BREAK and random garbage. While disabling sysrq for serial console would solve the problem with spurious false sysrq triggers, it's also desirable to have a way to enable sysrq back. As a measure of balance between on and off options, add MAGIC_SYSRQ_SERIAL_SEQUENCE which is a string sequence that can enable sysrq if it follows BREAK on a serial line. The longer the string - the less likely it may be in the garbage. Having the way to enable sysrq was beneficial to debug lockups with a manual investigation in field and on the other side preventing false sysrq detections.

Dmitry Safonov committed 6 years ago

Commit 68af4311 parent eaee4173 files · +77 −7Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/serial_core.h+1−0
@@ -243,6 +243,7 @@ struct uart_port { · 242 unmodified lines
243243 unsigned long sysrq; /* sysrq timeout */
244244 unsigned int sysrq_ch; /* char for sysrq */
245245 unsigned char has_sysrq;
246+ unsigned char sysrq_seq; /* index in sysrq_toggle_seq */
246247
247248 unsigned char hub6; /* this should be in the 8250 driver */
248249 unsigned char suspended;