ipro1000: Always use DELAY() for microsecond pauses (on Haiku.)

pause() has granularity of "hz", which on FreeBSD and in our compat layer
is defined to be 1000 (so, 1ms.) As "safe_pause_us" is used copoiously
throughout startup code, this meant that (1) startup takes 100-1000x longer
than it needed to (this driver seems to most commonly delay for 10us),
and (2) this could in theory block the boot for multiple minutes if one
got particularly unlucky with the scheduler.

Probably helps with or even outright fixes #14795.
This commit is contained in:
Augustin Cavalier 2019-01-04 17:06:22 -05:00
parent 046ae71e48
commit a381a48f86

View File

@ -83,11 +83,15 @@ ms_scale(int x) {
static inline void
safe_pause_us(int x) {
#ifndef __HAIKU__
if (cold) {
DELAY(x);
} else {
pause("e1000_delay", max(1, x/(1000000/hz)));
}
#else
DELAY(x);
#endif
}
static inline void