svn commit: r213117 - stable/8/sys/dev/xl
Pyun YongHyeon
yongari at FreeBSD.org
Fri Sep 24 19:04:18 UTC 2010
Author: yongari
Date: Fri Sep 24 19:04:17 2010
New Revision: 213117
URL: http://svn.freebsd.org/changeset/base/213117
Log:
MFC r211716:
Move xl_reset() to xl_init_locked(). This will make driver
initialize controller from a known good state. Previously driver
used to issue controller reset while TX/RX DMA are in progress.
I guess resetting controller in active TX/RX DMA cycle is to ensure
stopping I/Os in xl_shutdown(). I remember some buggy controllers
didn't respond with stop command if controller is under high
network load at the time of shutdown so resetting controller was
the only safe way to stop the I/Os. However, from my experiments,
controller always responded with stop command under high network
load so I think it's okay to remove the xl_reset() in
device_shutdown handler.
Resetting controller also will clear configured RX filter which
in turn will make WOL support hard because driver have to reprogram
RX filter in WOL handler as well as setting station address.
Modified:
stable/8/sys/dev/xl/if_xl.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
stable/8/sys/dev/xen/xenpci/ (props changed)
Modified: stable/8/sys/dev/xl/if_xl.c
==============================================================================
--- stable/8/sys/dev/xl/if_xl.c Fri Sep 24 19:00:15 2010 (r213116)
+++ stable/8/sys/dev/xl/if_xl.c Fri Sep 24 19:04:17 2010 (r213117)
@@ -1635,7 +1635,6 @@ xl_detach(device_t dev)
/* These should only be active if attach succeeded */
if (device_is_attached(dev)) {
XL_LOCK(sc);
- xl_reset(sc);
xl_stop(sc);
XL_UNLOCK(sc);
taskqueue_drain(taskqueue_swi, &sc->xl_task);
@@ -2246,7 +2245,6 @@ xl_intr(void *arg)
}
if (status & XL_STAT_ADFAIL) {
- xl_reset(sc);
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
xl_init_locked(sc);
}
@@ -2318,7 +2316,6 @@ xl_poll_locked(struct ifnet *ifp, enum p
}
if (status & XL_STAT_ADFAIL) {
- xl_reset(sc);
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
xl_init_locked(sc);
}
@@ -2754,6 +2751,9 @@ xl_init_locked(struct xl_softc *sc)
*/
xl_stop(sc);
+ /* Reset the chip to a known state. */
+ xl_reset(sc);
+
if (sc->xl_miibus == NULL) {
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_RESET);
xl_wait(sc);
@@ -3236,7 +3236,6 @@ xl_watchdog(struct xl_softc *sc)
device_printf(sc->xl_dev,
"no carrier - transceiver cable problem?\n");
- xl_reset(sc);
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
xl_init_locked(sc);
@@ -3335,7 +3334,6 @@ xl_shutdown(device_t dev)
sc = device_get_softc(dev);
XL_LOCK(sc);
- xl_reset(sc);
xl_stop(sc);
XL_UNLOCK(sc);
@@ -3367,7 +3365,6 @@ xl_resume(device_t dev)
XL_LOCK(sc);
- xl_reset(sc);
if (ifp->if_flags & IFF_UP) {
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
xl_init_locked(sc);
More information about the svn-src-stable
mailing list