On Mon, 20 Aug 2018, Arnd Bergmann wrote: > On Mon, Aug 20, 2018 at 4:17 PM Mikulas Patocka <mpatocka@xxxxxxxxxx> wrote: > > On Sun, 19 Aug 2018, okaya@xxxxxxxxxxxxxx wrote: > > > > > +my new email > > > > > > On 2018-08-18 19:03, Arnd Bergmann wrote: > > > > On Sat, Aug 18, 2018 at 12:05 AM Maciej W. Rozycki <macro@xxxxxxxxxxxxxx> > > > > I think we need to identify the driver that is failing. > > > > It also may be some timing issue. > > > > I observed that not every kernel with the patch > > 92d7223a74235054f2aa7227d207d9c57f84dca0 fails, some of them get stuck > > only at boot, some get stuck only at shutdown, some not at all. Although > > all the kernels with this patch reverted work. > > > > So the patch may have uncovered some timing problem somewhere. > > > > x86 has the function io_delay that injects delays between I/O accesses for > > hardware that needs it - does alpha have something like this? > > The I/O delay would be very low on my list of possible root causes > for this, hardly any hardware at all relies on it, and all uses I see > are related to outb(), which you've already shown not to be the problem > with my test patch. > > Arnd I think this is timing problem, not reordering problem. The serial port hardware doesn't have DMA. Before the patch, there was "write+mb+read"; after the patch there is "write+read". So, the patch changes the timing between write and read and the serial port and realtime clock choke on this. PC hardware from 1980s and 1990s didn't handle back-to-back accesses correctly and required i/o delays (accessing a dummy port 0x80 was a common practice) - and I think that the Alpha Avanti chipset suffers from the same problem. One possibility to fix it would be to add the barrier to io_serial_out and to real-time clock. Another possibility is to add barrier to all port-accessing functions and your patch did. The problem here is that no one has access to all Alpha chipsets, so we don't know how many of them suffer from this timing issue and what components of the chipsets are affected. Mikulas