On Wed, Dec 4, 2024, at 22:09, Guenter Roeck wrote: > On Mon, Nov 25, 2024 at 04:59:00PM +0100, Arnd Bergmann wrote: >> On Mon, Nov 25, 2024, at 12:06, Arnd Bergmann wrote: >> > +unsigned int nr_uarts = ARRAY_SIZE(old_serial_port);; >> > + >> >> Unfortunately, this breaks on non-x86 because of the check >> added in 59cfc45f17d6 ("serial: 8250: Do nothing if nr_uarts=0"). >> >> I still think it's the right idea, but need to unwind further >> to make this possible, and find a different fix for the bug >> from that commit. >> > > I decided to apply the patch below to my fixes branch. It doesn't change > the code, it just gets rid of the warning backtrace. I got stuck in this rabbit hole of running into more issues with the 8250 driver. Any time you touch something, it breaks elsewhere. I've uploaded what I have here now: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/log/?h=8250-cleanup but this probably needs more testing, and a few smaller changes > drivers/tty/serial/8250/8250_port.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/tty/serial/8250/8250_port.c > b/drivers/tty/serial/8250/8250_port.c > index 4d63d80e78a9..649e74e9b52f 100644 > --- a/drivers/tty/serial/8250/8250_port.c > +++ b/drivers/tty/serial/8250/8250_port.c > @@ -467,7 +467,8 @@ static void set_io_from_upio(struct uart_port *p) > break; > #endif > default: > - WARN(1, "Unsupported UART type %x\n", p->iotype); > + WARN(p->iotype != UPIO_PORT || p->iobase, > + "Unsupported UART type %x\n", p->iotype); > p->serial_in = no_serial_in; > p->serial_out = no_serial_out; > } I had considered this at first but didn't really want to do it like this because we should not be registering empty ports on platforms that don't use the setserial style override for the port configuration. It does of course address the warning, just not the underlying bug. Arnd