From: Jan Beulich <jbeulich@suse.com>
To: Benjamin Leggett <benjamin@edera.io>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Michal Orzel" <michal.orzel@amd.com>,
"Julien Grall" <julien@xen.org>,
"Roger Pau Monné" <roger@xenproject.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH] ns16550: add "auto" to scan PCI only when the default base has no UART
Date: Wed, 14 Oct 2026 08:21:24 +0200 [thread overview]
Message-ID: <a6a65b86-958f-434d-a070-e425990344df@suse.com> (raw)
In-Reply-To: <87bj8xs54e.fsf@edera.io>
On 13.10.2026 22:44, Benjamin Leggett wrote:
> Jan Beulich <jbeulich@suse.com> writes:
>
>> On 09.10.2026 22:24, Benjamin Leggett wrote:
>>> On some systems the console UART is at the legacy I/O port, and on
>>> others, such as Amazon EC2 bare metal instances, the only UART is on
>>> PCI. "com1=...,pci" finds the PCI UART, but it prefers any PCI serial
>>> device to the legacy port, so it is not correct on a system that has
>>> both. No option today says "use the legacy port, and scan PCI only if
>>> it has no UART". A deployment that boots one command line on many
>>> kinds of machine needs exactly that.
>>>
>>> Add "auto" as a value in the <io-base> position. With it, Xen probes
>>> the default base as usual. Only if check_existence() fails there does
>>> it scan PCI, as "pci" does. Without "auto", nothing changes.
>>
>> I've always been considering check_existence() as somewhat fragile (it's
>> not very difficult for it to yield a false positive, especially when
>> HAS_IOPORTS=n), which means that I'm not really convinced it can (reliably)
>> be used for the purpose here.
>
> How do you feel about making the retval for check_existence() work like so:
> - 1: a UART answered the probe at io_base.
> - 0: the probe ran, and no UART answered.
> - -1: the function cannot probe this base, so it did not test it.
>
> and returning the -1 in cases that would spuriously return 1 and be
> "false positives" today, so we don't try to probe something we
> shouldn't?
>
> That at least covers the cases I can see, including the HAS_IOPORTS one.
>
> e.g. `if auto && -1` -> we bail with "can't probe"
Makes sense, yet I wonder: Why did you raise the question here if 5 min
later you send a new version of the patch anyway?
And btw - that patch can't possibly be v1 anymore, yet it neither says
which version it is, nor what has changed from the earlier version.
Jan
next prev parent reply other threads:[~2026-10-14 6:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 18:43 [PATCH] ns16550: find the console UART on PCI when there is no legacy one Benjamin Leggett
2026-09-23 6:11 ` Jan Beulich
2026-09-23 15:38 ` Benjamin Leggett
2026-09-23 15:39 ` [PATCH] ns16550: add the Amazon EC2 PCI serial device Benjamin Leggett
2026-09-24 8:26 ` Jan Beulich
2026-10-09 20:24 ` [PATCH] ns16550: add "auto" to scan PCI only when the default base has no UART Benjamin Leggett
2026-10-12 12:30 ` Jan Beulich
[not found] ` <87bj8xs54e.fsf@edera.io>
2026-10-14 6:21 ` Jan Beulich [this message]
2026-10-13 20:49 ` Benjamin Leggett
2026-10-14 6:46 ` Jan Beulich
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=a6a65b86-958f-434d-a070-e425990344df@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=benjamin@edera.io \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger@xenproject.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.