Remove unnecessary controller reinitialization.

StarFire controller does not require controller reinitialization to
program perfect filters. While here, make driver immediately exit
from interrupt/polling handler if driver reinitialized controller.

PR:	kern/87506
This commit is contained in:
Pyun YongHyeon 2010-09-21 17:42:19 +00:00
parent bcb74c4c95
commit e9dfd82ff1

View File

@ -1826,7 +1826,10 @@ sf_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
else if ((status & SF_ISR_DMAERR) != 0) {
device_printf(sc->sf_dev,
"DMA error, resetting\n");
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
sf_init_locked(sc);
SF_UNLOCK(sc);
return (rx_npkts);
} else if ((status & SF_ISR_NO_TX_CSUM) != 0) {
sc->sf_statistics.sf_tx_gfp_stall++;
#ifdef SF_GFP_DEBUG
@ -1894,8 +1897,10 @@ sf_intr(void *arg)
else if ((status & SF_ISR_DMAERR) != 0) {
device_printf(sc->sf_dev,
"DMA error, resetting\n");
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
sf_init_locked(sc);
break;
SF_UNLOCK(sc);
return;
} else if ((status & SF_ISR_NO_TX_CSUM) != 0) {
sc->sf_statistics.sf_tx_gfp_stall++;
#ifdef SF_GFP_DEBUG
@ -1984,6 +1989,8 @@ sf_init_locked(struct sf_softc *sc)
SF_LOCK_ASSERT(sc);
ifp = sc->sf_ifp;
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
return;
mii = device_get_softc(sc->sf_miibus);
sf_stop(sc);
@ -2547,6 +2554,7 @@ sf_watchdog(struct sf_softc *sc)
if_printf(ifp, "watchdog timeout, %d Tx descs are active\n",
sc->sf_cdata.sf_tx_cnt);
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
sf_init_locked(sc);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))