Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jul 2013 06:46:46 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r253134 - head/sys/dev/hme
Message-ID:  <201307100646.r6A6kkMC021913@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Wed Jul 10 06:46:46 2013
New Revision: 253134
URL: http://svnweb.freebsd.org/changeset/base/253134

Log:
  Avoid controller reinitialization which could be triggered by
  dhclient(8) or alias addresses are added.
  
  Tested by:	dcx dcy <dcbsdx@hotmail.com>

Modified:
  head/sys/dev/hme/if_hme.c

Modified: head/sys/dev/hme/if_hme.c
==============================================================================
--- head/sys/dev/hme/if_hme.c	Wed Jul 10 04:59:10 2013	(r253133)
+++ head/sys/dev/hme/if_hme.c	Wed Jul 10 06:46:46 2013	(r253134)
@@ -742,6 +742,10 @@ hme_init_locked(struct hme_softc *sc)
 	u_int32_t n, v;
 
 	HME_LOCK_ASSERT(sc, MA_OWNED);
+
+	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+		return;
+
 	/*
 	 * Initialization sequence. The numbered steps below correspond
 	 * to the sequence outlined in section 6.3.5.1 in the Ethernet
@@ -1324,6 +1328,7 @@ hme_eint(struct hme_softc *sc, u_int sta
 	/* check for fatal errors that needs reset to unfreeze DMA engine */
 	if ((status & HME_SEB_STAT_FATAL_ERRORS) != 0) {
 		HME_WHINE(sc->sc_dev, "error signaled, status=%#x\n", status);
+		sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 		hme_init_locked(sc);
 	}
 }
@@ -1370,6 +1375,7 @@ hme_watchdog(struct hme_softc *sc)
 		device_printf(sc->sc_dev, "device timeout (no link)\n");
 	++ifp->if_oerrors;
 
+	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 	hme_init_locked(sc);
 	hme_start_locked(ifp);
 	return (EJUSTRETURN);



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