From: nerdopolis <bluescreen_avenger@verizon.net>
To: linux-kernel@vger.kernel.org
Cc: Petr Mladek <pmladek@suse.com>,
Steven Rostedt <rostedt@goodmis.org>,
Greg KH <gregkh@linuxfoundation.org>,
john.ogness@linutronix.de, senozhatsky@chromium.org,
tglx@linutronix.de, tony@atomide.com
Subject: Re: VT-less kernels, and /dev/console on x86
Date: Thu, 12 Sep 2024 12:48:01 -0400 [thread overview]
Message-ID: <4925457.GXAFRqVoOG@nerdopolis2> (raw)
In-Reply-To: <Zs3YyYG0RwNcG2vL@1wt.eu>
On Tuesday, August 27, 2024 9:46:49 AM EDT Willy Tarreau wrote:
> On Tue, Aug 27, 2024 at 08:53:49AM -0400, nerdopolis wrote:
> > > > If I get it correctly, you suggest to do not register serial port
> > > > when it is not physically connected. It makes some sense.
> > > >
> > > Hmm, now that might work, and is a good idea...
> > Although now that I think about it, could this cause unintended behavior on
> > some hardware? Or folks that might plug in the serial cable after booting for
> > whatever reason?
>
> The *vast* majority of serial ports spend their time non-connected, and
> are only used to connect to the equipment at runtime, to recover a lost
> access, or to connect locally to it during operations. What is proposed
> above scares me a little bit:
> - PC-like serial ports (DB-9) support hardware flow control using the
> RTS/CTS lines and are expected to be instantly usable when connecting
> something to them. The presence of a cable is detectable, though many
> will just have a local loop (CTS-RTS, DCD-DTR-DSR) and will in fact
> only detect that the connector is plugged in. Some don't even connect
> them, and turn off HW flow control.
>
> - many boards don't even have hardware flow control and only provide
> the usual 3-4 pins (GND, TX, RX and optional VCC). These ones will
> never be detected as "connected" and will be permanently broken.
>
> > I still kind of lean to CONFIG_NULL_TTY_CONSOLE, that way if enabled, and in
> > theory, only distributions that had CONFIG_VT_CONSOLE turned on would turn on
> > this option. That could allow /dev/console will still work the same way for
> > user space logging, while disabling vgacon and fbcon.
> >
> > And it could still be overridden by console=ttyS0, which I think is needed
> > anyway if you have CONFIG_VT_CONSOLE enabled
>
> That sounds safer. And even then, I still don't understand why the application
> logging to /dev/console needs to block on it instead of just dropping whatever
> doesn't fit there since that's the primary intent of an optional logging
> console, i.e. emit events but without preventing regular operations. Maybe
> *this* is the thing that would require a setting: wait or drop.
>
Sorry about the late reply, the application that is logging and dropping is
kind of unintentional I think. From how I understand it, systemd wants to
verify that /dev/console is actually /dev/console, so it calls isatty() on it.
isatty() in turn calls the TCGETS ioctl on /dev/console, which when the console
device is actually /dev/ttyS0, and /dev/ttyS0 is unplugged, it the ioctl fails,
and isatty() returns false, and systemd assumes that it is not a serial device,
and in turn it doesn't log because of that.
Thanks
> Just my two cents,
> Willy
>
next prev parent reply other threads:[~2024-09-12 17:08 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2669238.7s5MMGUR32.ref@nerdopolis2>
2024-08-18 0:09 ` VT-less kernels, and /dev/console on x86 nerdopolis
2024-08-18 1:07 ` Bagas Sanjaya
2024-08-18 2:31 ` nerdopolis
2024-08-18 5:12 ` Greg KH
2024-08-18 14:33 ` nerdopolis
2024-08-18 5:12 ` Greg KH
2024-08-18 12:33 ` nerdopolis
2024-08-18 14:30 ` nerdopolis
2024-08-19 15:09 ` Steven Rostedt
2024-08-19 15:50 ` nerdopolis
2024-08-20 13:29 ` Petr Mladek
2024-08-21 17:12 ` nerdopolis
2024-08-22 10:05 ` Petr Mladek
2024-08-22 12:49 ` nerdopolis
2024-08-27 12:53 ` nerdopolis
2024-08-27 13:46 ` Willy Tarreau
2024-09-12 16:48 ` nerdopolis [this message]
2024-09-12 17:25 ` Willy Tarreau
2024-09-12 18:46 ` nerdopolis
2024-09-13 2:22 ` nerdopolis
2024-09-17 12:54 ` nerdopolis
2024-10-15 13:26 ` nerdopolis
2024-09-12 12:29 ` nerdopolis
2024-09-12 13:27 ` Petr Mladek
2024-10-09 9:24 ` Bernd Petrovitsch
2024-10-09 17:49 ` nerdopolis
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=4925457.GXAFRqVoOG@nerdopolis2 \
--to=bluescreen_avenger@verizon.net \
--cc=gregkh@linuxfoundation.org \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=tglx@linutronix.de \
--cc=tony@atomide.com \
/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