Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Oct 2010 19:27:34 +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-8@freebsd.org
Subject:   svn commit: r213603 - stable/8/sys/dev/sf
Message-ID:  <201010081927.o98JRYEn007754@svn.freebsd.org>

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

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/8/sys/dev/sf/if_sf.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/sf/if_sf.c
==============================================================================
--- stable/8/sys/dev/sf/if_sf.c	Fri Oct  8 19:25:46 2010	(r213602)
+++ stable/8/sys/dev/sf/if_sf.c	Fri Oct  8 19:27:34 2010	(r213603)
@@ -1826,7 +1826,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
@@ -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))



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