From: "H. Peter Anvin" <hpa@zytor.com>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: Maarten Brock <Maarten.Brock@sttls.nl>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
"linux-api@vger.kernel.org" <linux-api@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: RFC: Serial port DTR/RTS - O_NRESETDEV
Date: Tue, 11 Nov 2025 13:28:40 -0800 [thread overview]
Message-ID: <85c9b487-eb18-46a9-babe-6223ae3e05f5@zytor.com> (raw)
In-Reply-To: <20251111043803.GK2988753@mit.edu>
On 2025-11-10 20:38, Theodore Ts'o wrote:
> On Mon, Nov 10, 2025 at 07:57:22PM -0800, H. Peter Anvin wrote:
>> I really think you are looking at this from a very odd point of
>> view, and you seem to be very inconsistent. Boot time setup? Isn't
>> that what setserial is for? We have the ability to feed this
>> configuration already, but you need a file descriptor.
>
> I'm not really fond of adding some new open flag that to me seems
> **very** serial / RS-485 specific, and so I'm trying to find some
> way to avoid it.
>
I don't think it is. "Opening this device for configuration."
> I also think that that the GPIO style timing requirements of RTS
> **really** should be done as a line discpline, and not in userspace.
>
No disagreement there -- and so it is. What I want to do is a way to *attach*
that line discipline without poking with the serial port itself. That's what
I keep trying to get at.
>> Honestly, though, I'm far less interested in what 8250-based hardware does than e.g. USB.
>
> I'm quite confident that USB won't have "state" that will be preserved
> across a reboot, because the device won't even get powered up until
> the USB device is attached. And part of the problem was that the
> requirements weren't particularly clear, and given the insistence that
> the "state" be preserved even across reboot, despite the serial port
> autoconfiguration, I had assumed you were posting uing the COM 1/2/3/4
> ports where autoconfiguration isn't stricty speaking necessary.
>
> In some ways, USB ports might be easier, since it should be possible
> to specify udev rules which get passed to the driver when the USB
> serial device is inserted, and so *that* can easily be done without
> needing a file descriptor.
>
> And for this sort of thing, it seems perfectly fair to hard code some
> specific behavior using either a boot command line or a udev rule,
> since you seem to be positing that the serial port will be dedicated
> to some kind of weird-shit RS-485 bus device, where any time RTS/DTR
> gets raised, the bus will malfunction in weird and wondrous ways....
But again, it is very much a configuration property. You don't know where
your dynamically assigned serial port will end up -- and you *can't*, because
it is a property of the DCE -- what is plugged *into* the device.
Now you have someone writing a terminal program or something like Arduino and
decide to enumerate serial ports (which, as I stated, you can't actually do
right now without opening the devices). This is why it makes sense for the
open() caller to declare intent; this is similar to how O_NDELAY replaced
callout devices.
It would be lovely if we could do something like
open("/dev/ttyS0/option-string") and so on, but that is well and truly a far
bigger change to the whole driver API.
-hpa
next prev parent reply other threads:[~2025-11-11 21:31 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-07 7:53 H. Peter Anvin
2025-11-07 17:37 ` Theodore Ts'o
2025-11-09 2:25 ` H. Peter Anvin
2025-11-10 3:35 ` Theodore Ts'o
2025-11-10 5:00 ` H. Peter Anvin
2025-11-10 10:06 ` Maarten Brock
2025-11-10 20:19 ` Theodore Ts'o
2025-11-10 21:05 ` H. Peter Anvin
2025-11-11 3:51 ` Theodore Ts'o
2025-11-11 3:57 ` H. Peter Anvin
2025-11-11 4:38 ` Theodore Ts'o
2025-11-11 10:21 ` Maarten Brock
2025-11-11 21:28 ` H. Peter Anvin [this message]
2025-11-12 11:22 ` Greg KH
2025-11-12 16:09 ` H. Peter Anvin
2025-11-12 16:46 ` Greg KH
2025-11-12 19:12 ` H. Peter Anvin
2025-11-12 19:39 ` Greg KH
2025-11-12 19:53 ` H. Peter Anvin
2025-11-12 19:55 ` H. Peter Anvin
2025-11-13 22:24 ` RFC: Serial port DTR/RTS - O_<something> H. Peter Anvin
2025-11-14 10:26 ` Maarten Brock
2025-11-14 18:49 ` Maciej W. Rozycki
2025-11-14 18:53 ` H. Peter Anvin
2025-11-15 21:29 ` Ned Ulbricht
2025-11-15 22:29 ` H. Peter Anvin
2025-11-16 0:47 ` H. Peter Anvin
2025-11-18 16:33 ` Ned Ulbricht
2025-11-18 17:31 ` H. Peter Anvin
2025-11-18 18:05 ` H. Peter Anvin
2025-11-20 13:31 ` Ned Ulbricht
2025-11-10 5:20 ` RFC: Serial port DTR/RTS - O_NRESETDEV H. Peter Anvin
2025-11-09 20:43 ` Maciej W. Rozycki
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=85c9b487-eb18-46a9-babe-6223ae3e05f5@zytor.com \
--to=hpa@zytor.com \
--cc=Maarten.Brock@sttls.nl \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=tytso@mit.edu \
/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
all inboxes | Powered by JetHome®