summaryrefslogtreecommitdiffstats
path: root/sys/dev/stge
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2010-09-21 17:52:32 +0000
committeryongari <yongari@FreeBSD.org>2010-09-21 17:52:32 +0000
commita709074512b3610411370da94e396a0b513f0433 (patch)
tree55d7a0ba61a7924bbed9fe3dbbcf7e971e974e1c /sys/dev/stge
parent731c1ece5f8ee655746419485db3771d0b19dfdb (diff)
downloadFreeBSD-src-a709074512b3610411370da94e396a0b513f0433.zip
FreeBSD-src-a709074512b3610411370da94e396a0b513f0433.tar.gz
Remove unnecessary controller reinitialization.
PR: kern/87506
Diffstat (limited to 'sys/dev/stge')
-rw-r--r--sys/dev/stge/if_stge.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/sys/dev/stge/if_stge.c b/sys/dev/stge/if_stge.c
index e289814..97ce63d 100644
--- a/sys/dev/stge/if_stge.c
+++ b/sys/dev/stge/if_stge.c
@@ -1377,6 +1377,7 @@ stge_watchdog(struct stge_softc *sc)
ifp = sc->sc_ifp;
if_printf(sc->sc_ifp, "device timeout\n");
ifp->if_oerrors++;
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
stge_init_locked(sc);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
stge_start_locked(ifp);
@@ -1405,7 +1406,10 @@ stge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
else if (ifp->if_mtu != ifr->ifr_mtu) {
ifp->if_mtu = ifr->ifr_mtu;
STGE_LOCK(sc);
- stge_init_locked(sc);
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+ stge_init_locked(sc);
+ }
STGE_UNLOCK(sc);
}
break;
@@ -1639,8 +1643,10 @@ stge_intr(void *arg)
}
force_init:
- if (reinit != 0)
+ if (reinit != 0) {
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
stge_init_locked(sc);
+ }
/* Re-enable interrupts. */
CSR_WRITE_2(sc, STGE_IntEnable, sc->sc_IntEnable);
@@ -1936,11 +1942,16 @@ stge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
if ((status & IS_HostError) != 0) {
device_printf(sc->sc_dev,
"Host interface error, resetting...\n");
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
stge_init_locked(sc);
+ break;
}
if ((status & IS_TxComplete) != 0) {
- if (stge_tx_error(sc) != 0)
+ if (stge_tx_error(sc) != 0) {
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
stge_init_locked(sc);
+ break;
+ }
}
}
@@ -2121,6 +2132,8 @@ stge_init_locked(struct stge_softc *sc)
STGE_LOCK_ASSERT(sc);
ifp = sc->sc_ifp;
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+ return;
mii = device_get_softc(sc->sc_miibus);
/*
OpenPOWER on IntegriCloud