Ah, I've always wondered when it's appropriate to use outb_p and when to
use outb. The lack of comments in <asm-i386/io.h> kept this a mystery.
Modern bus hardware doesn't need this sort of thing -- it enforces the
required delays itself.
Is the list of ports for which outb_p is appropriate a small and well
defined one?
> The delay must be sufficient for the hardware to have accomplished
> the switch. That's why writing to a hardware port is ideal. If you
> have fast hardware, the delay is low. If you have slow hardware, the
> delay is longer.
>
> I'm not going to debate this. If you understand hardware there
> is nothing to debate.
Agreed, however it's not that obvious. Not all delays are to
synchronise at bus rates. Sometimes the delay is because some _other_
component on a board, not directly connected to the bus, needs a short
delay. E.g. a chip that can only be clocked at max. 1MHz. The driver
author uses outb_p because he thinks that limits the rate to 0.5MHz, and
there is no other way to get that sort of data rate, but no it limits
the rate to 3MHz on your board. Ah well.
If it was really as simple as matching the bus rate, there would be no
need for REALLY_SLOW_IO on some machines would there? (Are
REALLY_SLOW_IO and SLOW_IO_BY_JUMPING ever used?)
-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/