[lkml]   [2020]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH-next 3/3] serial/sysrq: Add MAGIC_SYSRQ_SERIAL_SEQUENCE
On 1/10/20 10:32 PM, Dmitry Safonov wrote:
> On 1/10/20 4:46 PM, Greg Kroah-Hartman wrote:
> [..]
>>> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
>>> index 6ac9dfed3423..f70eba032d0b 100644
>>> --- a/drivers/tty/serial/serial_core.c
>>> +++ b/drivers/tty/serial/serial_core.c
>>> @@ -3081,6 +3081,38 @@ void uart_insert_char(struct uart_port *port, unsigned int status,
>>> }
>>> EXPORT_SYMBOL_GPL(uart_insert_char);
>>> +const char sysrq_toggle_seq[] = CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE;
>>> +
>>> +static void uart_sysrq_on(struct work_struct *w)
>>> +{
>>> + sysrq_toggle_support(1);
>>> + pr_info("SysRq is enabled by magic sequience on serial\n");
>> Do we want to say what serial port it is enabled on?
> Makes sense, will add.

Ah, I've managed to forget to mention that I didn't add the port name
into the message in v2. I experimented a bit - it's getting a bit
complicated how-to protect (char *name) for just this message.
Like, SysRq can be theoretically enabled on two serials at the same
moment - so some locking is needed to make the printed name sane.

As sysrq_toggle_support() is a global-enable knob for sysrq (also can be
switched in /proc/sys/kernel/sysrq) I'm not sure if it's worth to
complicate code to print through which serial console SysRq has been

I can still do it in v3 if you insist.

And sorry about forgetting to mention this - thought I'll write reply
after I send v2 and somehow it slipped my mind.


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