Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Mar 2009 16:44:37 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
Subject:   svn commit: r190083 - in stable/6/sys: . contrib/pf dev/bge dev/cxgb
Message-ID:  <200903191644.n2JGibK6069437@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Thu Mar 19 16:44:37 2009
New Revision: 190083
URL: http://svn.freebsd.org/changeset/base/190083

Log:
  MFC: r188164, r188457
  
  - device_shutdown returns an int.
  - Don't reset the PHY probe retry counter within the loop so
    it will eventually terminate as intended. [1]
  
  Submitted by:	Helen Zhang [1]

Modified:
  stable/6/sys/   (props changed)
  stable/6/sys/contrib/pf/   (props changed)
  stable/6/sys/dev/bge/if_bge.c
  stable/6/sys/dev/cxgb/   (props changed)

Modified: stable/6/sys/dev/bge/if_bge.c
==============================================================================
--- stable/6/sys/dev/bge/if_bge.c	Thu Mar 19 16:44:37 2009	(r190082)
+++ stable/6/sys/dev/bge/if_bge.c	Thu Mar 19 16:44:37 2009	(r190083)
@@ -348,7 +348,7 @@ static void bge_init_locked(struct bge_s
 static void bge_init(void *);
 static void bge_stop(struct bge_softc *);
 static void bge_watchdog(struct bge_softc *);
-static void bge_shutdown(device_t);
+static int bge_shutdown(device_t);
 static int bge_ifmedia_upd_locked(struct ifnet *);
 static int bge_ifmedia_upd(struct ifnet *);
 static void bge_ifmedia_sts(struct ifnet *, struct ifmediareq *);
@@ -2661,11 +2661,11 @@ bge_attach(device_t dev)
 		 * if we get a conflict with the ASF firmware accessing
 		 * the PHY.
 		 */
+		trys = 0;
 		BGE_CLRBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP);
 again:
 		bge_asf_driver_up(sc);
 
-		trys = 0;
 		if (mii_phy_probe(dev, &sc->bge_miibus,
 		    bge_ifmedia_upd, bge_ifmedia_sts)) {
 			if (trys++ < 4) {
@@ -4223,17 +4223,18 @@ bge_stop(struct bge_softc *sc)
  * Stop all chip I/O so that the kernel's probe routines don't
  * get confused by errant DMAs when rebooting.
  */
-static void
+static int
 bge_shutdown(device_t dev)
 {
 	struct bge_softc *sc;
 
 	sc = device_get_softc(dev);
-
 	BGE_LOCK(sc);
 	bge_stop(sc);
 	bge_reset(sc);
 	BGE_UNLOCK(sc);
+
+	return (0);
 }
 
 static int



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