On Tue, 21 Aug 2018, Arnd Bergmann wrote:
> > The lockup happens somewhere in the function autoconfig in
> > drivers/tty/serial/8250/8250_port.c, but I don't know where exactly
> > because serial console doesn't work while the port is being probed.
> >
> > When I use console on a graphics card, the lockup doesn't happen.
>
> Ok, this does strongly suggest that it is the outb() operation that I
> suspected after all, I just sent you a wrong patch to test, failing
> to realize that alpha has two implementations of outb, and that the
> extern one is the one that gets used in a defconfig build.
I keep forgetting it's PCI port I/O involved here. :(
PCI port I/O accesses are I believe supposed to be fully unbuffered, that
is you need a completion barrier after the write operation that accesses
an MMIO location mapped to the PCI port I/O space, so that at the return
from `outX' the write cycle will have actually gone out to PCI already.
For the Alpha platform that would mean an MB instruction followed by a
read-back operation, i.e. conceptually something like:
void outb(u8 b, unsigned long port)
{
iowrite8(b, ioport_map(port, 1));
mb();
ioread8(ioport_map(0x80, 1));
}
(reading `port' may have side effects and should not be done in such a
piece of generic code).
There might be a better location than 0x80 to read back as that location
may incur an unnecessary delay to account for a slow device; possibly
using `__raw_readl' rather than `ioread8' even, but that would have to be
determined, and likely system-specific.
Maciej