Re: git: 1491fe8f864a - main - uart/pci: support 16550A PCI serial devices
Date: Thu, 16 Apr 2026 20:17:03 UTC
On Fri, Mar 27, 2026 at 08:33:37AM +0000, Roger Pau Monné wrote:
> The branch main has been updated by royger:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=1491fe8f864af5af37e83f1d12459905fb6097fd
>
> commit 1491fe8f864af5af37e83f1d12459905fb6097fd
> Author: Roger Pau Monné <royger@FreeBSD.org>
> AuthorDate: 2026-03-26 10:01:57 +0000
> Commit: Roger Pau Monné <royger@FreeBSD.org>
> CommitDate: 2026-03-27 08:26:32 +0000
>
> uart/pci: support 16550A PCI serial devices
>
> Expand the current check to also attach the ns8250 driver to devices
> reporting as 16550A. This has been tested to work on a real device.
>
> From an inspection of the code in the ns8250 driver it seems like it should
> support up to 16950A devices, but I don't have hardware to ensure that,
> hence be conservative with the change.
I have a system which hangs in uart_bus_probe() after this change. It
has a 2-port UART PCI card installed:
puc0@pci0:6:0:0: class=0x070002 rev=0x00 hdr=0x00 vendor=0x1415 device=0xc158 subvendor=0x1415 subdevice=0xc158
vendor = 'Oxford Semiconductor Ltd'
device = 'OXPCIe952 Dual Native 950 UART'
class = simple comms
subclass = UART
Normally puc(4) attaches to it and creates two child uart devices:
puc0
Interrupt request lines:
0x11
pcib7 memory window:
0x84000000-0x841fffff
0x84200000-0x843fffff
0x84400000-0x84403fff
uart2
puc0 I/O memory mapping:
0x84401000-0x844011ff
puc0 port numbers:
0x1
uart3
puc0 I/O memory mapping:
0x84401200-0x844013ff
puc0 port numbers:
0x2
After this change, though, uart(4) tries to probe the device directly
and hangs. Presumably we still want to exclude at least multi-port
devices here?
> MFC: 2 weeks
> Reviewed by: imp
> Differential revision: https://reviews.freebsd.org/D56095
> ---
> sys/dev/uart/uart_bus_pci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sys/dev/uart/uart_bus_pci.c b/sys/dev/uart/uart_bus_pci.c
> index 22af8ee8663c..7087958cbfa9 100644
> --- a/sys/dev/uart/uart_bus_pci.c
> +++ b/sys/dev/uart/uart_bus_pci.c
> @@ -297,7 +297,7 @@ uart_pci_probe(device_t dev)
> }
> if (pci_get_class(dev) == PCIC_SIMPLECOMM &&
> pci_get_subclass(dev) == PCIS_SIMPLECOMM_UART &&
> - pci_get_progif(dev) < PCIP_SIMPLECOMM_UART_16550A) {
> + pci_get_progif(dev) <= PCIP_SIMPLECOMM_UART_16550A) {
> /* XXX rclk what to do */
> id = &cid;
> sc->sc_class = &uart_ns8250_class;
>