When sending a command and reading the data from a certain chip, say the RTC, different documents say that we should wait for some time before reading from the device to make su
Those dummy reads implement a delay; from Linux I/O port programming mini-HOWTO:
The
inb_p()
,outb_p()
,inw_p()
, andoutw_p()
macros work otherwise identically to the ones above, but they do an additional short (about one microsecond) delay after the port access; you can make the delay about four microseconds with#define REALLY_SLOW_IO
before you#include
.These macros normally (unless you
#define SLOW_IO_BY_JUMPING
, which is probably less accurate) use a port output to port0x80
for their delay, so you need to give access to port0x80
withioperm()
first (outputs to port0x80
should not affect any part of the system). For more versatile methods of delaying, read on.