Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Sep 2010 19:31:53 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r213134 - stable/7/sys/dev/age
Message-ID:  <201009241931.o8OJVrbv037392@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Fri Sep 24 19:31:53 2010
New Revision: 213134
URL: http://svn.freebsd.org/changeset/base/213134

Log:
  MFC r211768:
    Remove unnecessary controller reinitialization.
  
    PR:	kern/87506

Modified:
  stable/7/sys/dev/age/if_age.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/age/if_age.c
==============================================================================
--- stable/7/sys/dev/age/if_age.c	Fri Sep 24 19:31:08 2010	(r213133)
+++ stable/7/sys/dev/age/if_age.c	Fri Sep 24 19:31:53 2010	(r213134)
@@ -1781,6 +1781,7 @@ age_watchdog(struct age_softc *sc)
 	if ((sc->age_flags & AGE_FLAG_LINK) == 0) {
 		if_printf(sc->age_ifp, "watchdog timeout (missed link)\n");
 		ifp->if_oerrors++;
+		ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 		age_init_locked(sc);
 		return;
 	}
@@ -1793,6 +1794,7 @@ age_watchdog(struct age_softc *sc)
 	}
 	if_printf(sc->age_ifp, "watchdog timeout\n");
 	ifp->if_oerrors++;
+	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 	age_init_locked(sc);
 	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
 		taskqueue_enqueue(sc->age_tq, &sc->age_tx_task);
@@ -1817,8 +1819,10 @@ age_ioctl(struct ifnet *ifp, u_long cmd,
 		else if (ifp->if_mtu != ifr->ifr_mtu) {
 			AGE_LOCK(sc);
 			ifp->if_mtu = ifr->ifr_mtu;
-			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
+				ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 				age_init_locked(sc);
+			}
 			AGE_UNLOCK(sc);
 		}
 		break;
@@ -2165,6 +2169,7 @@ age_int_task(void *arg, int pending)
 			if ((status & INTR_DMA_WR_TO_RST) != 0)
 				device_printf(sc->age_dev,
 				    "DMA write error! -- resetting\n");
+			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 			age_init_locked(sc);
 		}
 		if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
@@ -2529,6 +2534,9 @@ age_init_locked(struct age_softc *sc)
 	ifp = sc->age_ifp;
 	mii = device_get_softc(sc->age_miibus);
 
+	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+		return;
+
 	/*
 	 * Cancel any pending I/O.
 	 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009241931.o8OJVrbv037392>