On Thu, May 07, 2020 at 04:18:49AM -0400, Mikulas Patocka wrote: > > > On Wed, 6 May 2020, Greg Kroah-Hartman wrote: > > > On Wed, May 06, 2020 at 01:04:38PM -0400, Mikulas Patocka wrote: > > > > > > I've created this patch that adds a global macro/variable > > > serial_port_needs_delay. I've also deleted UPQ_DELAY_BEFORE_READ and test > > > serial_port_needs_delay directly in io_serial_in, so that the compiler > > > will optimize it out on non-alpha architectures. > > > > That's not good, what about systems with hundreds of serial ports? > > I doubt that someone will conect hundreds of serial ports to such an old > alpha machine :) > > > > > But, there is no other way to detect this based on hardware > > > > signatures/types instead? That is usually the best way to do it, right? > > > > > > It's hard to detect Alpha without using '#ifdef CONFIG_ALPHA' :) The ISA > > > serial port hardware is simple, so I think that you can't distinguish it > > > just based on its behavior. > > > > The ISA serial port hardware does not have a unique vendor/product id > > somewhere? Some other sort of definition that we can use to determine > > exactly what type of system we are running on? > > AFAIK it doesn't. You can only distinguish 8250, 16550 and 16550A - but > not the vendor. > > > > Index: linux-stable/drivers/tty/serial/8250/8250_port.c > > > =================================================================== > > > --- linux-stable.orig/drivers/tty/serial/8250/8250_port.c 2020-05-06 18:54:24.000000000 +0200 > > > +++ linux-stable/drivers/tty/serial/8250/8250_port.c 2020-05-06 18:54:24.000000000 +0200 > > > @@ -30,6 +30,7 @@ > > > #include <linux/uaccess.h> > > > #include <linux/pm_runtime.h> > > > #include <linux/ktime.h> > > > +#include <linux/pci.h> > > > > > > #include <asm/io.h> > > > #include <asm/irq.h> > > > @@ -442,6 +443,9 @@ static unsigned int mem32be_serial_in(st > > > > > > static unsigned int io_serial_in(struct uart_port *p, int offset) > > > { > > > + if (serial_port_needs_delay) > > > + ndelay(300); > > > > Again, this should be a per-port thing, not all ports in the system are > > this broken, right? > > > > thanks, > > > > greg k-h > > Here is the patch that uses per-port flag UPQ_DELAY_BEFORE_READ. The flag > is activated if we have the specific PCI-ISA bridge and if the serial port > is an ISA port. Better, care to submit this in a format that it can be applied in? thanks, greg k-h