Reduce spin wait time consumed in GMII register access routines.
Waiting for 1ms for each GMII register access looks overkill and it may also decrease overall performance of driver because re(4) invokes mii_tick for every hz. Tested by: rpaulo
This commit is contained in:
parent
9ca5167c5a
commit
b45fb24843
@ -417,13 +417,12 @@ re_gmii_readreg(device_t dev, int phy, int reg)
|
||||
}
|
||||
|
||||
CSR_WRITE_4(sc, RL_PHYAR, reg << 16);
|
||||
DELAY(1000);
|
||||
|
||||
for (i = 0; i < RL_TIMEOUT; i++) {
|
||||
DELAY(30);
|
||||
rval = CSR_READ_4(sc, RL_PHYAR);
|
||||
if (rval & RL_PHYAR_BUSY)
|
||||
break;
|
||||
DELAY(100);
|
||||
}
|
||||
|
||||
if (i == RL_TIMEOUT) {
|
||||
@ -445,13 +444,12 @@ re_gmii_writereg(device_t dev, int phy, int reg, int data)
|
||||
|
||||
CSR_WRITE_4(sc, RL_PHYAR, (reg << 16) |
|
||||
(data & RL_PHYAR_PHYDATA) | RL_PHYAR_BUSY);
|
||||
DELAY(1000);
|
||||
|
||||
for (i = 0; i < RL_TIMEOUT; i++) {
|
||||
DELAY(30);
|
||||
rval = CSR_READ_4(sc, RL_PHYAR);
|
||||
if (!(rval & RL_PHYAR_BUSY))
|
||||
break;
|
||||
DELAY(100);
|
||||
}
|
||||
|
||||
if (i == RL_TIMEOUT) {
|
||||
|
Loading…
Reference in New Issue
Block a user