Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp1217848ybh; Sat, 3 Aug 2019 20:53:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8eKW+b4P8/UbhixvvPKxEVNG5H/lA9SeExD1U+uhqVmBkc9OENYm1bWbgEYRmXZ46wrpr X-Received: by 2002:a17:90a:24e4:: with SMTP id i91mr12451367pje.9.1564890791364; Sat, 03 Aug 2019 20:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564890791; cv=none; d=google.com; s=arc-20160816; b=aVeG3jBD5+hCDsvQjyBEHeCXfEfaMcK/LGbiQTP07uq+c4+xm/h8CTzxzJD1kh62UX QZoKF+NOTgPvNtC487eD1+aqMEtMp/yok9SiTQmenh+bcx9YtMHV4JSR5BjloNwoNQ9H zMKHtfcTeAC6x/HAakxbwDckodO/E/FXPWWosDfPW+tdCzHBc/3fDqwx2AqcClEL3YPs gObC3NIQKzj6BdnLNUBvTXLCmXHhfHcwHXye9NvphUAgMSC0gvcOyw7NEbcMBNnPcvfq pJY4zUh6HIDh5EvO+O7OY62HOrPoSIKrCOeW88GCqluXFn/k4IR0yTIV7plWwo4BXBDn DztQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=XUiqb2geXflcEMMY2ySD/SPe0bVldFUq80qrEH20eNc=; b=jfiSITICesIAgbj7CEQJqo0sLbXgeHETMdyc16mfvmqFPEBIGpi2c3/bSoZHK0fMso l8vCYBSgar08AYNomzHihzvPZ2yMy0TjwehGT8XT9M39+8dzj79OvKow+gsCVNUUzMWq gCwnwQcFreqrFFyFU6/FBwqZpzOAl9/seQGgV8qfrDH3wqVeOEqCulH4pjXYqzBCYfyH ejoMSU8+C71E+CNNKDlt0D0N6BnRHOmKHpJdyLM2kWQTKHM9Y4yW2pCubimj6jKA88EO oQxGWwMakJKo09gc+zbTPI06385B4uBdUxsqMQraBiHxNZx+eWJcpH8eafAiaa6DuUrz fb0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f69si9583717pjg.43.2019.08.03.20.52.56; Sat, 03 Aug 2019 20:53:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727936AbfHCPQA (ORCPT + 99 others); Sat, 3 Aug 2019 11:16:00 -0400 Received: from tartarus.angband.pl ([54.37.238.230]:33818 "EHLO tartarus.angband.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725844AbfHCPQA (ORCPT ); Sat, 3 Aug 2019 11:16:00 -0400 Received: from kilobyte by tartarus.angband.pl with local (Exim 4.92) (envelope-from ) id 1htvlE-0002YB-QL; Sat, 03 Aug 2019 17:15:56 +0200 Date: Sat, 3 Aug 2019 17:15:56 +0200 From: Adam Borowski To: Greg Kroah-Hartman Cc: Paul Menzel , linux-serial@vger.kernel.org, Linux Kernel Mailing List , Donald Buczek Subject: Re: Device to write to all (serial) consoles Message-ID: <20190803151556.GA9187@angband.pl> References: <32c2d26f-ec4a-b9a6-b42c-07b27f99ea28@molgen.mpg.de> <20190802160243.GA15484@kroah.com> <20190803132323.GB6703@angband.pl> <20190803135537.GA1743@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190803135537.GA1743@kroah.com> X-Junkbait: aaron@angband.pl, zzyx@angband.pl User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: kilobyte@angband.pl X-SA-Exim-Scanned: No (on tartarus.angband.pl); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 03, 2019 at 03:55:37PM +0200, Greg Kroah-Hartman wrote: > On Sat, Aug 03, 2019 at 03:23:23PM +0200, Adam Borowski wrote: > > On Fri, Aug 02, 2019 at 09:59:06PM +0200, Paul Menzel wrote: > > > Because the cable is always connected to the port on the back side, and > > > sometimes the port in the front has ID 0, and the one in the back 1, and > > > other times vice versa. We do not want to track that, and it would be > > > convenient to just write to both ports. > > > > Sounds like an XY problem then: what you want is not writing to all ports, > > but to have the port assignments stable (see also: disk device reordering). > > You can get that information from the symlinks in /dev/serial/ which > udev creates. Doesn't seem to work for me, for any ttyS0 ttyS1 ttySAC1 device: Box one, PCIe card + one USB dongle: 07:00.0 Serial controller: MosChip Semiconductor Technology Ltd. MCS9922 PCIe Multi-I/O Controller 07:00.1 Serial controller: MosChip Semiconductor Technology Ltd. MCS9922 PCIe Multi-I/O Controller Bus 003 Device 004: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0 /dev/serial/by-path/pci-0000:0b:00.3-usb-0:4:1.0-port0 Only ttyUSB0 is there. Box two, on-board + one USB dongle: [ 3.404340] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled [ 3.431287] 00:01: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A Bus 001 Device 002: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP2102/CP2109 UART Bridge Controller [CP210x family] /dev/serial/by-id/usb-Silicon_Labs_CP2104_USB_to_UART_Bridge_Controller_00DB1604-if00-port0 /dev/serial/by-path/pci-0000:00:14.0-usb-0:1:1.0-port0 Box three: RockPro64, euler + USB dongle, kernel 4.4. Box four: Pine64, euler. Box five: Odroid-U2, something GPIOish (ttySAC1), kernel 5.0. Most are running kernel 5.2, Debian unstable. And indeed, in /lib/udev/rules.d/60-serial.rules : # /dev/serial/by-path/, /dev/serial/by-id/ for USB devices KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="serial_end" Like me, Paul is using ttyS0 for server-side. Meow! -- ⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢰⠒⠀⣿⡁ 10 people enter a bar: 1 who understands binary, ⢿⡄⠘⠷⠚⠋⠀ 1 who doesn't, D who prefer to write it as hex, ⠈⠳⣄⠀⠀⠀⠀ and 1 who narrowly avoided an off-by-one error.