Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Aug 2010 18:40:11 +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: r211765 - head/sys/dev/vr
Message-ID:  <201008241840.o7OIeBj7084477@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Tue Aug 24 18:40:11 2010
New Revision: 211765
URL: http://svn.freebsd.org/changeset/base/211765

Log:
  Remove unnecessary controller reinitialization.
  CAM filter handling was rewritten long time ago so it should not
  require controller reinitialization.
  
  PR:	kern/87506

Modified:
  head/sys/dev/vr/if_vr.c

Modified: head/sys/dev/vr/if_vr.c
==============================================================================
--- head/sys/dev/vr/if_vr.c	Tue Aug 24 18:17:40 2010	(r211764)
+++ head/sys/dev/vr/if_vr.c	Tue Aug 24 18:40:11 2010	(r211765)
@@ -1560,6 +1560,7 @@ vr_tick(void *xsc)
 		sc->vr_stat.num_restart++;
 		vr_stop(sc);
 		vr_reset(sc);
+		sc->vr_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 		vr_init_locked(sc);
 		sc->vr_flags &= ~VR_F_RESTART;
 	}
@@ -2016,6 +2017,9 @@ vr_init_locked(struct vr_softc *sc)
 	ifp = sc->vr_ifp;
 	mii = device_get_softc(sc->vr_miibus);
 
+	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+		return;
+
 	/* Cancel pending I/O and free all RX/TX buffers. */
 	vr_stop(sc);
 	vr_reset(sc);
@@ -2287,6 +2291,7 @@ vr_watchdog(struct vr_softc *sc)
 			if_printf(sc->vr_ifp, "watchdog timeout "
 			   "(missed link)\n");
 		ifp->if_oerrors++;
+		ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 		vr_init_locked(sc);
 		return;
 	}
@@ -2296,6 +2301,7 @@ vr_watchdog(struct vr_softc *sc)
 
 	vr_stop(sc);
 	vr_reset(sc);
+	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 	vr_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?201008241840.o7OIeBj7084477>