From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 19:41:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09B31106567A; Tue, 24 Aug 2010 19:41:16 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED61A8FC15; Tue, 24 Aug 2010 19:41:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OJfFPq085858; Tue, 24 Aug 2010 19:41:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OJfFDk085856; Tue, 24 Aug 2010 19:41:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008241941.o7OJfFDk085856@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 24 Aug 2010 19:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211768 - head/sys/dev/age X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 19:41:16 -0000 Author: yongari Date: Tue Aug 24 19:41:15 2010 New Revision: 211768 URL: http://svn.freebsd.org/changeset/base/211768 Log: Remove unnecessary controller reinitialization. PR: kern/87506 Modified: head/sys/dev/age/if_age.c Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Tue Aug 24 18:52:24 2010 (r211767) +++ head/sys/dev/age/if_age.c Tue Aug 24 19:41:15 2010 (r211768) @@ -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. */