kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: Marc SCHAEFER <schaefer@alphanet.ch>
To: kernelnewbies@kernelnewbies.org
Subject: Does sysrq work over USB?
Date: Tue, 16 Nov 2021 15:04:56 +0100	[thread overview]
Message-ID: <20211116140456.GA10235@alphanet.ch> (raw)

Hello,

I made the following setup work, that is I can send break and '?'
(to get the magic sysrq help) or 's' to do an Emergency sync, and the
kernel logs it:

 laptop                                        apu2
    USB serial port ------- null modem ------- ttyS0 internal 16550A

(an apu2 is an embedded amd64 computer [4])

As it works, of course MAGIC_SYSRQ is enabled, including for serial
ports, and the correct value is in the /proc pseudo-file.

It works with the getty enabled or disabled.

However, the following does not work to support magic sysrq, although
bidirectionnal communication also works with cu [5], with the correct
speed set:

 laptop                                        apu2
    USB serial port ------- null modem ------- USB serial port

First, reading documentation, I thought that this would not be possible with
USB and only with the internal serial port [1], but then, reading kernel
source, it looks it should work with my adapter:

   Oct 11 14:30:56 apu2-init7 kernel: [    9.915105] usb 2-2: pl2303 converter now attached to ttyUSB0

since the driver [2] contains code for magic sysrq, see line 993 for
sysrq mode and line 892 for break handling, with implementation in [3]
(lines 589-597).

I am running Debian buster kernel 4.19.0-18-amd64 on the apu2.

Should I abandon all hope to make it work with USB, or should it work?

Thank your for any pointers.

[1] https://www.kernel.org/doc/Documentation/admin-guide/sysrq.rst
    "On the serial console (PC style standard serial ports only)"

[2] https://github.com/jplozi/linux-4.19/blob/loadbalancing/drivers/usb/serial/pl2303.c

[3] https://github.com/jplozi/linux-4.19/blob/loadbalancing/drivers/usb/serial/generic.c

[4] https://pcengines.ch/apu2.htm

[5] https://linux.die.net/man/1/cu
    from the days before 2003 where I was doing UUCP
       cu -l ttyUSB0 -s 9600

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

             reply	other threads:[~2021-11-16 14:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16 14:04 Marc SCHAEFER [this message]
2021-11-16 21:29 ` Does sysrq work over USB? Valentin Vidić
2021-11-21 15:47   ` Marc SCHAEFER
2021-11-21 17:51     ` Valentin Vidić
2021-11-21 18:07       ` Valentin Vidić
2021-11-21 20:49         ` Marc SCHAEFER

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211116140456.GA10235@alphanet.ch \
    --to=schaefer@alphanet.ch \
    --cc=kernelnewbies@kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).