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.
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -243,6 +243,7 @@ struct uart_port { · 242 unmodified lines | |||
| 243 | unsigned long sysrq; /* sysrq timeout */ | 243 | unsigned long sysrq; /* sysrq timeout */ |
| 244 | unsigned int sysrq_ch; /* char for sysrq */ | 244 | unsigned int sysrq_ch; /* char for sysrq */ |
| 245 | unsigned char has_sysrq; | 245 | unsigned char has_sysrq; |
| 246 | unsigned char sysrq_seq; /* index in sysrq_toggle_seq */ | ||
| 246 | 247 | ||
| 247 | unsigned char hub6; /* this should be in the 8250 driver */ | 248 | unsigned char hub6; /* this should be in the 8250 driver */ |
| 248 | unsigned char suspended; | 249 | unsigned char suspended; |