Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Oct 2010 19:29:17 +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: r213604 - stable/7/sys/dev/sf
Message-ID:  <201010081929.o98JTHqu008667@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Fri Oct  8 19:29:17 2010
New Revision: 213604
URL: http://svn.freebsd.org/changeset/base/213604

Log:
  MFC r212971:
    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

Modified:
  stable/7/sys/dev/sf/if_sf.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/sf/if_sf.c
==============================================================================
--- stable/7/sys/dev/sf/if_sf.c	Fri Oct  8 19:27:34 2010	(r213603)
+++ stable/7/sys/dev/sf/if_sf.c	Fri Oct  8 19:29:17 2010	(r213604)
@@ -1821,7 +1821,10 @@ sf_poll(struct ifnet *ifp, enum poll_cmd
 			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
@@ -1888,8 +1891,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
@@ -1978,6 +1983,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);
@@ -2541,6 +2548,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))



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