Re: [PATCH] Cleanup port 0x80 use (was: Re: IO delay ...)

H. Peter Anvin (hpa@zytor.com)
15 Mar 2002 12:41:09 -0800


Followup to: <E16lw5V-0004ES-00@the-village.bc.nu>
By author: Alan Cox <alan@lxorguk.ukuu.org.uk>
In newsgroup: linux.dev.kernel
>
> > I am still wondering, though, why this method of getting a delay
> > is used so often. IMO in most places one could use udelay(1) instead,
> > with much less risk of doing wrong.
>
> udelay(1) I don't believe is enough. Unfortunately I can't find my
> documentation on the ISA bus which covers the timeout for acknowledging an
> address cycle. Otherwise for tsc capable boxes I agree entirely.
>

The ISA bus doesn't time out; a cycle on the ISA bus just happens, and
the fact that noone is there to listen doesn't seem to matter.

The delay is something like 8 cycles @ 8.3 MHz or around 1 ms.
However, an important thing to note is that this delay applies *at the
southbridge*. An OUT is a fully synchronizing operation, so it
doesn't just give a 1 ms delay due to the ISA bus cycle, but it also
makes sure everything else in the system is completed before the
timing counter even starts to tick.

Of course, if all you're doing is IOIO (on an x86!) it doesn't matter
-- IOIO is fully synchronizing anyway.

-hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<amsp@zytor.com>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/