From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E3AEC433EF for ; Tue, 16 Nov 2021 14:25:09 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CE8F061407 for ; Tue, 16 Nov 2021 14:25:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CE8F061407 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=alphanet.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94.2) (envelope-from ) id 1mmz9p-0003Ux-Nv; Tue, 16 Nov 2021 09:09:57 -0500 Received: from shakotay.alphanet.ch ([46.140.72.222]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mmz5t-0002WC-R1 for kernelnewbies@kernelnewbies.org; Tue, 16 Nov 2021 09:05:54 -0500 Received: by shakotay.alphanet.ch (Postfix, from userid 1022) id 7FE6C124EC3E; Tue, 16 Nov 2021 15:05:51 +0100 (CET) Received: from reliant.alphanet.ch (localhost [127.0.0.1]) by shakotay.alphanet.ch (Postfix) with ESMTP id 85E02124EB66 for ; Tue, 16 Nov 2021 15:05:43 +0100 (CET) Received: by reliant.alphanet.ch (Postfix, from userid 1000) id CA30917FD47; Tue, 16 Nov 2021 15:04:56 +0100 (CET) Date: Tue, 16 Nov 2021 15:04:56 +0100 From: Marc SCHAEFER To: kernelnewbies@kernelnewbies.org Subject: Does sysrq work over USB? Message-ID: <20211116140456.GA10235@alphanet.ch> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org 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