Re: [PATCH] alpha: add udelay to io port paths

From: Linus Torvalds (torvalds@xxxxxxxxxxxxxxxxxxxx)
Date: Thu Apr 04 2019 - 21:12:12 EST

On Wed, Apr 3, 2019 at 9:28 AM Mikulas Patocka <mpatocka@xxxxxxxxxx> wrote:
> So, I submit this patch that adds 1us delay between any I/O accesses
> directed at the ISA bus. This patch makes my machine boot. 1us seems to be
> minimal acceptable value, with 800ns I still get hangs.

I don't think this is right.

The *read* in 'in[bwl]' likely should not need an extra delay. An ISA
port access will simply take that long on proper ISA hardware.

The problem is almost c ertainly on the write side. An 'out[bwl]' on
x86 will actualluy wait for the write to complete, while I suspect the
problem on alpha is that writes are posted, so they happen
"immediately" as far as the CPU is concerned. The 1us delay will then
effectively wait for the write to complete on the device.

I wonder if there is some way on alpha to wait for ISA writes to
complete (perhaps doing a dummy read from the IO complex)?