lkml.org 
[lkml]   [2020]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCHv2-next 2/3] serial/sysrq: Add MAGIC_SYSRQ_SERIAL_SEQUENCE
From
Date
On Tue, 2020-01-14 at 17:19 +0000, Dmitry Safonov wrote:
> Many embedded boards have a disconnected TTL level serial which can
> generate some garbage that can lead to spurious false sysrq detects.

Hi again Dmitry. trivia:

> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
[]
> +/**
> + * uart_try_toggle_sysrq - Enables SysRq from serial line
> + * @port: uart_port structure where char(s) after BREAK met
> + * @ch: new character in the sequence after received BREAK
> + *
> + * Enables magic SysRq when the required sequence is met on port
> + * (see CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE).
> + *
> + * Returns 0 if @ch is out of enabling sequence and should be
> + * handled some other way, 1 if @ch was consumed.
> + */

Normally bool functions return values are true/false not 1/0.

> +static bool uart_try_toggle_sysrq(struct uart_port *port, unsigned int ch)
> +{
> + if (ARRAY_SIZE(sysrq_toggle_seq) <= 1)
> + return 0;

return false;

etc...


\
 
 \ /
  Last update: 2020-01-14 18:31    [W:0.073 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site