819-uart-0003-tty-serial-fsl_lpuart-add-magic-SysRq-support.patch 875 B

12345678910111213141516171819202122232425262728
  1. From 74d7e639cce7ae95cacd948dcf5ed3b28c3fff5c Mon Sep 17 00:00:00 2001
  2. From: Fugang Duan <[email protected]>
  3. Date: Mon, 28 Jan 2019 10:27:27 +0800
  4. Subject: [PATCH] tty: serial: fsl_lpuart: add magic SysRq support
  5. Add magic SysRq key support.
  6. Signed-off-by: Fugang Duan <[email protected]>
  7. ---
  8. drivers/tty/serial/fsl_lpuart.c | 7 ++++++-
  9. 1 file changed, 6 insertions(+), 1 deletion(-)
  10. --- a/drivers/tty/serial/fsl_lpuart.c
  11. +++ b/drivers/tty/serial/fsl_lpuart.c
  12. @@ -931,7 +931,12 @@ static void lpuart32_rxint(struct lpuart
  13. */
  14. sr = lpuart32_read(&sport->port, UARTSTAT);
  15. rx = lpuart32_read(&sport->port, UARTDATA);
  16. - rx &= 0x3ff;
  17. +
  18. + if ((sr & UARTSTAT_FE) && (rx & UARTDATA_FRETSC) &&
  19. + !(rx & UARTDATA_MASK)) {
  20. + if (uart_handle_break(&sport->port))
  21. + continue;
  22. + }
  23. if (uart_handle_sysrq_char(&sport->port, (unsigned char)rx))
  24. continue;