From marcus@shumai.marcuscom.com  Sun Oct 16 06:03:27 2005
Return-Path: <marcus@shumai.marcuscom.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id BFC7816A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 16 Oct 2005 06:03:27 +0000 (GMT)
	(envelope-from marcus@shumai.marcuscom.com)
Received: from shumai.marcuscom.com (creme-brulee.marcuscom.com [24.172.16.118])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 619AF43D46
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 16 Oct 2005 06:03:27 +0000 (GMT)
	(envelope-from marcus@shumai.marcuscom.com)
Received: from shumai.marcuscom.com (localhost.marcuscom.com [127.0.0.1])
	by shumai.marcuscom.com (8.13.4/8.13.4) with ESMTP id j9G63M6v055717
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 16 Oct 2005 02:03:22 -0400 (EDT)
	(envelope-from marcus@shumai.marcuscom.com)
Received: (from marcus@localhost)
	by shumai.marcuscom.com (8.13.4/8.13.4/Submit) id j9G63MKg055710;
	Sun, 16 Oct 2005 02:03:22 -0400 (EDT)
	(envelope-from marcus)
Message-Id: <200510160603.j9G63MKg055710@shumai.marcuscom.com>
Date: Sun, 16 Oct 2005 02:03:22 -0400 (EDT)
From: Joe Marcus Clarke <marcus@freebsd.org>
Reply-To: Joe Marcus Clarke <marcus@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] Fix alias support on vr interfaces
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         87506
>Category:       kern
>Synopsis:       [vr] [patch] Fix alias support on vr interfaces
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    yongari
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 16 06:10:12 GMT 2005
>Closed-Date:    Fri Oct 08 23:40:55 UTC 2010
>Last-Modified:  Fri Oct 08 23:40:55 UTC 2010
>Originator:     Joe Marcus Clarke
>Release:        FreeBSD 6.0-BETA5 i386
>Organization:
>Environment:
System: FreeBSD shumai.marcuscom.com 6.0-BETA5 FreeBSD 6.0-BETA5 #15: Thu Oct 6 22:15:33 EDT 2005 marcus@shumai.marcuscom.com:/usr/obj/usr/src/sys/SHUMAI i386


	
>Description:
Adding an address alias to a vr interface will trigger an interface reset,
and all other addresses will be dropped from the interface.  The patch
below corrects this for vr interfaces, but I believe rl, sis, ti, and tl
interfaces are also affected.
>How-To-Repeat:
ifconfig vr0 inet 192.168.1.2/32 alias

Afterward, all address will be removed from the interface except the newly
created alias.
>Fix:

http://www.marcuscom.com/downloads/if_vr.c.diff

>Release-Note:
>Audit-Trail:

From: John Baldwin <jhb@freebsd.org>
To: bug-followup@freebsd.org,
 marcus@freebsd.org
Cc:  
Subject: Re: kern/87506: [PATCH] Fix alias support on vr interfaces
Date: Thu, 20 Oct 2005 16:53:31 -0400

 I've reproduced the same behavior on an rl(4) interface on my laptop, but it 
 only occurs if rl0 uses DHCP (and thus dhclient).  If I statically configure 
 rl0 then I can add aliases no problem.  Perhaps when an alias is added and 
 the chip is reset, dhclient thinks that the link has reset and tears down the 
 lease or something.
 
 -- 
 John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
 "Power Users Use the Power to Serve"  =  http://www.FreeBSD.org

From: Joe Marcus Clarke <marcus@FreeBSD.org>
To: John Baldwin <jhb@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/87506: [PATCH] Fix alias support on vr interfaces
Date: Thu, 20 Oct 2005 17:05:11 -0400

 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
 John Baldwin wrote:
 | I've reproduced the same behavior on an rl(4) interface on my laptop,
 but it
 | only occurs if rl0 uses DHCP (and thus dhclient).  If I statically
 configure
 | rl0 then I can add aliases no problem.  Perhaps when an alias is added
 and
 | the chip is reset, dhclient thinks that the link has reset and tears
 down the
 | lease or something.
 |
 
 Does the vr patch fix this problem with rl (with the proper
 modifications, of course)?
 
 Joe
 
 - --
 Joe Marcus Clarke
 FreeBSD GNOME Team	::	gnome@FreeBSD.org
 FreeNode / #freebsd-gnome
 http://www.FreeBSD.org/gnome
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.2 (Darwin)
 Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
 
 iD8DBQFDWAaHb2iPiv4Uz4cRArULAKCUWYNY2NjJ+9kwWO4PwukcWRwhggCfYIYq
 V92Ksk6CkGYbIzn9NP0yM9Y=
 =/mPW
 -----END PGP SIGNATURE-----

From: John Baldwin <jhb@freebsd.org>
To: Joe Marcus Clarke <marcus@freebsd.org>
Cc: bug-followup@freebsd.org
Subject: Re: kern/87506: [PATCH] Fix alias support on vr interfaces
Date: Fri, 21 Oct 2005 15:38:50 -0400

 On Thursday 20 October 2005 05:05 pm, Joe Marcus Clarke wrote:
 > John Baldwin wrote:
 > | I've reproduced the same behavior on an rl(4) interface on my laptop,
 >
 > but it
 >
 > | only occurs if rl0 uses DHCP (and thus dhclient).  If I statically
 >
 > configure
 >
 > | rl0 then I can add aliases no problem.  Perhaps when an alias is added
 >
 > and
 >
 > | the chip is reset, dhclient thinks that the link has reset and tears
 >
 > down the
 >
 > | lease or something.
 >
 > Does the vr patch fix this problem with rl (with the proper
 > modifications, of course)?
 
 It might, but it would break some other things.  Some chips reprogram their RX 
 filters via foo_init(), so bypassing foo_init() in those drivers would mean 
 that they wouldn't actually receive traffic for the aliased addresses.  The 
 bug is nto in the drivers, but somewhere else in the system and needs to be 
 addressed there.
 
 -- 
 John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
 "Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: vwe 
Responsible-Changed-When: Wed Jan 14 21:39:50 UTC 2009 
Responsible-Changed-Why:  

Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87506 
Responsible-Changed-From-To: freebsd-net->yongari 
Responsible-Changed-By: andre 
Responsible-Changed-When: Mon Aug 23 18:19:58 UTC 2010 
Responsible-Changed-Why:  
Over to expert. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87506 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Tue, 24 Aug 2010 18:40:23 +0000 (UTC)

 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))
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Tue, 24 Aug 2010 18:52:38 +0000 (UTC)

 Author: yongari
 Date: Tue Aug 24 18:52:24 2010
 New Revision: 211767
 URL: http://svn.freebsd.org/changeset/base/211767
 
 Log:
   Remove unnecessary controller reinitialization.
   
   PR:	kern/87506
 
 Modified:
   head/sys/pci/if_rl.c
 
 Modified: head/sys/pci/if_rl.c
 ==============================================================================
 --- head/sys/pci/if_rl.c	Tue Aug 24 18:44:12 2010	(r211766)
 +++ head/sys/pci/if_rl.c	Tue Aug 24 18:52:24 2010	(r211767)
 @@ -1302,6 +1302,7 @@ rl_rxeof(struct rl_softc *sc)
  		    total_len < ETHER_MIN_LEN ||
  		    total_len > ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN) {
  			ifp->if_ierrors++;
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			rl_init_locked(sc);
  			return (rx_npkts);
  		}
 @@ -1413,6 +1414,7 @@ rl_txeof(struct rl_softc *sc)
  				CSR_WRITE_4(sc, RL_TXCFG, RL_TXCFG_CONFIG);
  			oldthresh = sc->rl_txthresh;
  			/* error recovery */
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			rl_init_locked(sc);
  			/* restore original threshold */
  			sc->rl_txthresh = oldthresh;
 @@ -1606,8 +1608,10 @@ rl_poll_locked(struct ifnet *ifp, enum p
  
  		/* XXX We should check behaviour on receiver stalls. */
  
 -		if (status & RL_ISR_SYSTEM_ERR)
 +		if (status & RL_ISR_SYSTEM_ERR) {
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			rl_init_locked(sc);
 +		}
  	}
  	return (rx_npkts);
  }
 @@ -1645,8 +1649,10 @@ rl_intr(void *arg)
  			rl_rxeof(sc);
  		if ((status & RL_ISR_TX_OK) || (status & RL_ISR_TX_ERR))
  			rl_txeof(sc);
 -		if (status & RL_ISR_SYSTEM_ERR)
 +		if (status & RL_ISR_SYSTEM_ERR) {
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			rl_init_locked(sc);
 +		}
  	}
  
  	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
 @@ -1808,6 +1814,9 @@ rl_init_locked(struct rl_softc *sc)
  
  	mii = device_get_softc(sc->rl_miibus);
  
 +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +		return;
 +
  	/*
  	 * Cancel pending I/O and free all RX/TX buffers.
  	 */
 @@ -2036,6 +2045,7 @@ rl_watchdog(struct rl_softc *sc)
  
  	rl_txeof(sc);
  	rl_rxeof(sc);
 +	sc->rl_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  	rl_init_locked(sc);
  }
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Tue, 24 Aug 2010 19:41:24 +0000 (UTC)

 Author: yongari
 Date: Tue Aug 24 19:41:15 2010
 New Revision: 211768
 URL: http://svn.freebsd.org/changeset/base/211768
 
 Log:
   Remove unnecessary controller reinitialization.
   
   PR:	kern/87506
 
 Modified:
   head/sys/dev/age/if_age.c
 
 Modified: head/sys/dev/age/if_age.c
 ==============================================================================
 --- head/sys/dev/age/if_age.c	Tue Aug 24 18:52:24 2010	(r211767)
 +++ head/sys/dev/age/if_age.c	Tue Aug 24 19:41:15 2010	(r211768)
 @@ -1781,6 +1781,7 @@ age_watchdog(struct age_softc *sc)
  	if ((sc->age_flags & AGE_FLAG_LINK) == 0) {
  		if_printf(sc->age_ifp, "watchdog timeout (missed link)\n");
  		ifp->if_oerrors++;
 +		ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  		age_init_locked(sc);
  		return;
  	}
 @@ -1793,6 +1794,7 @@ age_watchdog(struct age_softc *sc)
  	}
  	if_printf(sc->age_ifp, "watchdog timeout\n");
  	ifp->if_oerrors++;
 +	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  	age_init_locked(sc);
  	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
  		taskqueue_enqueue(sc->age_tq, &sc->age_tx_task);
 @@ -1817,8 +1819,10 @@ age_ioctl(struct ifnet *ifp, u_long cmd,
  		else if (ifp->if_mtu != ifr->ifr_mtu) {
  			AGE_LOCK(sc);
  			ifp->if_mtu = ifr->ifr_mtu;
 -			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
 +				ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  				age_init_locked(sc);
 +			}
  			AGE_UNLOCK(sc);
  		}
  		break;
 @@ -2165,6 +2169,7 @@ age_int_task(void *arg, int pending)
  			if ((status & INTR_DMA_WR_TO_RST) != 0)
  				device_printf(sc->age_dev,
  				    "DMA write error! -- resetting\n");
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			age_init_locked(sc);
  		}
  		if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
 @@ -2529,6 +2534,9 @@ age_init_locked(struct age_softc *sc)
  	ifp = sc->age_ifp;
  	mii = device_get_softc(sc->age_miibus);
  
 +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +		return;
 +
  	/*
  	 * Cancel any pending I/O.
  	 */
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Wed,  1 Sep 2010 22:16:35 +0000 (UTC)

 Author: yongari
 Date: Wed Sep  1 22:16:25 2010
 New Revision: 212120
 URL: http://svn.freebsd.org/changeset/base/212120
 
 Log:
   Avoid controller reinitialization which could be triggered by
   dhclient(8) or alias addresses are added.
   
   PR:	kern/87506
 
 Modified:
   head/sys/dev/sis/if_sis.c
 
 Modified: head/sys/dev/sis/if_sis.c
 ==============================================================================
 --- head/sys/dev/sis/if_sis.c	Wed Sep  1 22:08:23 2010	(r212119)
 +++ head/sys/dev/sis/if_sis.c	Wed Sep  1 22:16:25 2010	(r212120)
 @@ -1741,6 +1741,7 @@ sis_poll(struct ifnet *ifp, enum poll_cm
  
  		if (status & SIS_ISR_SYSERR) {
  			sis_reset(sc);
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			sis_initl(sc);
  		}
  	}
 @@ -1796,6 +1797,7 @@ sis_intr(void *arg)
  
  		if (status & SIS_ISR_SYSERR) {
  			sis_reset(sc);
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			sis_initl(sc);
  			SIS_UNLOCK(sc);
  			return;
 @@ -1971,6 +1973,9 @@ sis_initl(struct sis_softc *sc)
  
  	SIS_LOCK_ASSERT(sc);
  
 +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +		return;
 +
  	/*
  	 * Cancel pending I/O and free all RX/TX buffers.
  	 */
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Tue, 21 Sep 2010 17:25:21 +0000 (UTC)

 Author: yongari
 Date: Tue Sep 21 17:25:15 2010
 New Revision: 212968
 URL: http://svn.freebsd.org/changeset/base/212968
 
 Log:
   Remove unnecessary controller reinitialization.
   
   PR:	kern/87506
 
 Modified:
   head/sys/dev/ae/if_ae.c
 
 Modified: head/sys/dev/ae/if_ae.c
 ==============================================================================
 --- head/sys/dev/ae/if_ae.c	Tue Sep 21 16:50:24 2010	(r212967)
 +++ head/sys/dev/ae/if_ae.c	Tue Sep 21 17:25:15 2010	(r212968)
 @@ -565,6 +565,8 @@ ae_init_locked(ae_softc_t *sc)
  	AE_LOCK_ASSERT(sc);
  
  	ifp = sc->ifp;
 +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +		return (0);
  	mii = device_get_softc(sc->miibus);
  
  	ae_stop(sc);
 @@ -1786,7 +1788,10 @@ ae_int_task(void *arg, int pending)
  	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
  		if ((val & (AE_ISR_DMAR_TIMEOUT | AE_ISR_DMAW_TIMEOUT |
  		    AE_ISR_PHY_LINKDOWN)) != 0) {
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			ae_init_locked(sc);
 +			AE_UNLOCK(sc);
 +			return;
  		}
  		if ((val & AE_ISR_TX_EVENT) != 0)
  			ae_tx_intr(sc);
 @@ -1997,6 +2002,7 @@ ae_watchdog(ae_softc_t *sc)
  		if_printf(ifp, "watchdog timeout - resetting.\n");
  
  	ifp->if_oerrors++;
 +	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  	ae_init_locked(sc);
  	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
  		taskqueue_enqueue(sc->tq, &sc->tx_task);
 @@ -2107,8 +2113,10 @@ ae_ioctl(struct ifnet *ifp, u_long cmd, 
  		else if (ifp->if_mtu != ifr->ifr_mtu) {
  			AE_LOCK(sc);
  			ifp->if_mtu = ifr->ifr_mtu;
 -			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
 +				ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  				ae_init_locked(sc);
 +			}
  			AE_UNLOCK(sc);
  		}
  		break;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Tue, 21 Sep 2010 17:42:27 +0000 (UTC)

 Author: yongari
 Date: Tue Sep 21 17:42:19 2010
 New Revision: 212971
 URL: http://svn.freebsd.org/changeset/base/212971
 
 Log:
   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:
   head/sys/dev/sf/if_sf.c
 
 Modified: head/sys/dev/sf/if_sf.c
 ==============================================================================
 --- head/sys/dev/sf/if_sf.c	Tue Sep 21 17:37:28 2010	(r212970)
 +++ head/sys/dev/sf/if_sf.c	Tue Sep 21 17:42:19 2010	(r212971)
 @@ -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))
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Tue, 21 Sep 2010 17:52:42 +0000 (UTC)

 Author: yongari
 Date: Tue Sep 21 17:52:32 2010
 New Revision: 212972
 URL: http://svn.freebsd.org/changeset/base/212972
 
 Log:
   Remove unnecessary controller reinitialization.
   
   PR:	kern/87506
 
 Modified:
   head/sys/dev/stge/if_stge.c
 
 Modified: head/sys/dev/stge/if_stge.c
 ==============================================================================
 --- head/sys/dev/stge/if_stge.c	Tue Sep 21 17:42:19 2010	(r212971)
 +++ head/sys/dev/stge/if_stge.c	Tue Sep 21 17:52:32 2010	(r212972)
 @@ -1377,6 +1377,7 @@ stge_watchdog(struct stge_softc *sc)
  	ifp = sc->sc_ifp;
  	if_printf(sc->sc_ifp, "device timeout\n");
  	ifp->if_oerrors++;
 +	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  	stge_init_locked(sc);
  	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
  		stge_start_locked(ifp);
 @@ -1405,7 +1406,10 @@ stge_ioctl(struct ifnet *ifp, u_long cmd
  		else if (ifp->if_mtu != ifr->ifr_mtu) {
  			ifp->if_mtu = ifr->ifr_mtu;
  			STGE_LOCK(sc);
 -			stge_init_locked(sc);
 +			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
 +				ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 +				stge_init_locked(sc);
 +			}
  			STGE_UNLOCK(sc);
  		}
  		break;
 @@ -1639,8 +1643,10 @@ stge_intr(void *arg)
  	}
  
  force_init:
 -	if (reinit != 0)
 +	if (reinit != 0) {
 +		ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  		stge_init_locked(sc);
 +	}
  
  	/* Re-enable interrupts. */
  	CSR_WRITE_2(sc, STGE_IntEnable, sc->sc_IntEnable);
 @@ -1936,11 +1942,16 @@ stge_poll(struct ifnet *ifp, enum poll_c
  			if ((status & IS_HostError) != 0) {
  				device_printf(sc->sc_dev,
  				    "Host interface error, resetting...\n");
 +				ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  				stge_init_locked(sc);
 +				break;
  			}
  			if ((status & IS_TxComplete) != 0) {
 -				if (stge_tx_error(sc) != 0)
 +				if (stge_tx_error(sc) != 0) {
 +					ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  					stge_init_locked(sc);
 +					break;
 +				}
  			}
  		}
  
 @@ -2121,6 +2132,8 @@ stge_init_locked(struct stge_softc *sc)
  	STGE_LOCK_ASSERT(sc);
  
  	ifp = sc->sc_ifp;
 +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +		return;
  	mii = device_get_softc(sc->sc_miibus);
  
  	/*
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: yongari 
State-Changed-When: Tue Sep 21 18:16:54 UTC 2010 
State-Changed-Why:  
All drivers in tree except drivers for old ISA/PCI hardwares and 
Intel maintained ones(em, lem, igb, ixgb and ixgbe), no longer 
perform unnecessary controller reinitialization. 
It's hard to find these old controllers in market so this makes 
hard to write patches. Intel maintainer shall fix their code to 
minimize controller reinitialization in near future, I hope. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87506 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Fri, 24 Sep 2010 19:19:58 +0000 (UTC)

 Author: yongari
 Date: Fri Sep 24 19:19:53 2010
 New Revision: 213126
 URL: http://svn.freebsd.org/changeset/base/213126
 
 Log:
   MFC r211765:
     Remove unnecessary controller reinitialization.
     CAM filter handling was rewritten long time ago so it should not
     require controller reinitialization.
   
     PR:	kern/87506
 
 Modified:
   stable/8/sys/dev/vr/if_vr.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/vr/if_vr.c
 ==============================================================================
 --- stable/8/sys/dev/vr/if_vr.c	Fri Sep 24 19:18:03 2010	(r213125)
 +++ stable/8/sys/dev/vr/if_vr.c	Fri Sep 24 19:19:53 2010	(r213126)
 @@ -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))
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Fri, 24 Sep 2010 19:22:48 +0000 (UTC)

 Author: yongari
 Date: Fri Sep 24 19:22:41 2010
 New Revision: 213127
 URL: http://svn.freebsd.org/changeset/base/213127
 
 Log:
   MFC r211765:
     Remove unnecessary controller reinitialization.
     CAM filter handling was rewritten long time ago so it should not
     require controller reinitialization.
   
     PR:	kern/87506
 
 Modified:
   stable/7/sys/dev/vr/if_vr.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/vr/if_vr.c
 ==============================================================================
 --- stable/7/sys/dev/vr/if_vr.c	Fri Sep 24 19:19:53 2010	(r213126)
 +++ stable/7/sys/dev/vr/if_vr.c	Fri Sep 24 19:22:41 2010	(r213127)
 @@ -1557,6 +1557,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;
  	}
 @@ -2008,6 +2009,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);
 @@ -2279,6 +2283,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;
  	}
 @@ -2288,6 +2293,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))
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Fri, 24 Sep 2010 19:27:53 +0000 (UTC)

 Author: yongari
 Date: Fri Sep 24 19:27:47 2010
 New Revision: 213130
 URL: http://svn.freebsd.org/changeset/base/213130
 
 Log:
   MFC r211767:
     Remove unnecessary controller reinitialization.
   
     PR:	kern/87506
 
 Modified:
   stable/8/sys/pci/if_rl.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/pci/if_rl.c
 ==============================================================================
 --- stable/8/sys/pci/if_rl.c	Fri Sep 24 19:26:27 2010	(r213129)
 +++ stable/8/sys/pci/if_rl.c	Fri Sep 24 19:27:47 2010	(r213130)
 @@ -1302,6 +1302,7 @@ rl_rxeof(struct rl_softc *sc)
  		    total_len < ETHER_MIN_LEN ||
  		    total_len > ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN) {
  			ifp->if_ierrors++;
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			rl_init_locked(sc);
  			return (rx_npkts);
  		}
 @@ -1413,6 +1414,7 @@ rl_txeof(struct rl_softc *sc)
  				CSR_WRITE_4(sc, RL_TXCFG, RL_TXCFG_CONFIG);
  			oldthresh = sc->rl_txthresh;
  			/* error recovery */
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			rl_init_locked(sc);
  			/* restore original threshold */
  			sc->rl_txthresh = oldthresh;
 @@ -1606,8 +1608,10 @@ rl_poll_locked(struct ifnet *ifp, enum p
  
  		/* XXX We should check behaviour on receiver stalls. */
  
 -		if (status & RL_ISR_SYSTEM_ERR)
 +		if (status & RL_ISR_SYSTEM_ERR) {
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			rl_init_locked(sc);
 +		}
  	}
  	return (rx_npkts);
  }
 @@ -1645,8 +1649,10 @@ rl_intr(void *arg)
  			rl_rxeof(sc);
  		if ((status & RL_ISR_TX_OK) || (status & RL_ISR_TX_ERR))
  			rl_txeof(sc);
 -		if (status & RL_ISR_SYSTEM_ERR)
 +		if (status & RL_ISR_SYSTEM_ERR) {
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			rl_init_locked(sc);
 +		}
  	}
  
  	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
 @@ -1808,6 +1814,9 @@ rl_init_locked(struct rl_softc *sc)
  
  	mii = device_get_softc(sc->rl_miibus);
  
 +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +		return;
 +
  	/*
  	 * Cancel pending I/O and free all RX/TX buffers.
  	 */
 @@ -2036,6 +2045,7 @@ rl_watchdog(struct rl_softc *sc)
  
  	rl_txeof(sc);
  	rl_rxeof(sc);
 +	sc->rl_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  	rl_init_locked(sc);
  }
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Fri, 24 Sep 2010 19:29:05 +0000 (UTC)

 Author: yongari
 Date: Fri Sep 24 19:29:01 2010
 New Revision: 213131
 URL: http://svn.freebsd.org/changeset/base/213131
 
 Log:
   MFC r211767:
     Remove unnecessary controller reinitialization.
   
     PR:	kern/87506
 
 Modified:
   stable/7/sys/pci/if_rl.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/pci/if_rl.c
 ==============================================================================
 --- stable/7/sys/pci/if_rl.c	Fri Sep 24 19:27:47 2010	(r213130)
 +++ stable/7/sys/pci/if_rl.c	Fri Sep 24 19:29:01 2010	(r213131)
 @@ -1301,6 +1301,7 @@ rl_rxeof(struct rl_softc *sc)
  		    total_len < ETHER_MIN_LEN ||
  		    total_len > ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN) {
  			ifp->if_ierrors++;
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			rl_init_locked(sc);
  			return;
  		}
 @@ -1410,6 +1411,7 @@ rl_txeof(struct rl_softc *sc)
  				CSR_WRITE_4(sc, RL_TXCFG, RL_TXCFG_CONFIG);
  			oldthresh = sc->rl_txthresh;
  			/* error recovery */
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			rl_init_locked(sc);
  			/* restore original threshold */
  			sc->rl_txthresh = oldthresh;
 @@ -1600,8 +1602,10 @@ rl_poll_locked(struct ifnet *ifp, enum p
  
  		/* XXX We should check behaviour on receiver stalls. */
  
 -		if (status & RL_ISR_SYSTEM_ERR)
 +		if (status & RL_ISR_SYSTEM_ERR) {
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			rl_init_locked(sc);
 +		}
  	}
  }
  #endif /* DEVICE_POLLING */
 @@ -1638,8 +1642,10 @@ rl_intr(void *arg)
  			rl_rxeof(sc);
  		if ((status & RL_ISR_TX_OK) || (status & RL_ISR_TX_ERR))
  			rl_txeof(sc);
 -		if (status & RL_ISR_SYSTEM_ERR)
 +		if (status & RL_ISR_SYSTEM_ERR) {
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			rl_init_locked(sc);
 +		}
  	}
  
  	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
 @@ -1801,6 +1807,9 @@ rl_init_locked(struct rl_softc *sc)
  
  	mii = device_get_softc(sc->rl_miibus);
  
 +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +		return;
 +
  	/*
  	 * Cancel pending I/O and free all RX/TX buffers.
  	 */
 @@ -2029,6 +2038,7 @@ rl_watchdog(struct rl_softc *sc)
  
  	rl_txeof(sc);
  	rl_rxeof(sc);
 +	sc->rl_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  	rl_init_locked(sc);
  }
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Fri, 24 Sep 2010 19:30:41 +0000 (UTC)

 Author: yongari
 Date: Fri Sep 24 19:30:34 2010
 New Revision: 213132
 URL: http://svn.freebsd.org/changeset/base/213132
 
 Log:
   MFC r211768:
     Remove unnecessary controller reinitialization.
   
     PR:	kern/87506
 
 Modified:
   stable/8/sys/dev/age/if_age.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/age/if_age.c
 ==============================================================================
 --- stable/8/sys/dev/age/if_age.c	Fri Sep 24 19:29:01 2010	(r213131)
 +++ stable/8/sys/dev/age/if_age.c	Fri Sep 24 19:30:34 2010	(r213132)
 @@ -1781,6 +1781,7 @@ age_watchdog(struct age_softc *sc)
  	if ((sc->age_flags & AGE_FLAG_LINK) == 0) {
  		if_printf(sc->age_ifp, "watchdog timeout (missed link)\n");
  		ifp->if_oerrors++;
 +		ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  		age_init_locked(sc);
  		return;
  	}
 @@ -1793,6 +1794,7 @@ age_watchdog(struct age_softc *sc)
  	}
  	if_printf(sc->age_ifp, "watchdog timeout\n");
  	ifp->if_oerrors++;
 +	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  	age_init_locked(sc);
  	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
  		taskqueue_enqueue(sc->age_tq, &sc->age_tx_task);
 @@ -1817,8 +1819,10 @@ age_ioctl(struct ifnet *ifp, u_long cmd,
  		else if (ifp->if_mtu != ifr->ifr_mtu) {
  			AGE_LOCK(sc);
  			ifp->if_mtu = ifr->ifr_mtu;
 -			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
 +				ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  				age_init_locked(sc);
 +			}
  			AGE_UNLOCK(sc);
  		}
  		break;
 @@ -2165,6 +2169,7 @@ age_int_task(void *arg, int pending)
  			if ((status & INTR_DMA_WR_TO_RST) != 0)
  				device_printf(sc->age_dev,
  				    "DMA write error! -- resetting\n");
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			age_init_locked(sc);
  		}
  		if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
 @@ -2529,6 +2534,9 @@ age_init_locked(struct age_softc *sc)
  	ifp = sc->age_ifp;
  	mii = device_get_softc(sc->age_miibus);
  
 +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +		return;
 +
  	/*
  	 * Cancel any pending I/O.
  	 */
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Fri, 24 Sep 2010 19:31:58 +0000 (UTC)

 Author: yongari
 Date: Fri Sep 24 19:31:53 2010
 New Revision: 213134
 URL: http://svn.freebsd.org/changeset/base/213134
 
 Log:
   MFC r211768:
     Remove unnecessary controller reinitialization.
   
     PR:	kern/87506
 
 Modified:
   stable/7/sys/dev/age/if_age.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/age/if_age.c
 ==============================================================================
 --- stable/7/sys/dev/age/if_age.c	Fri Sep 24 19:31:08 2010	(r213133)
 +++ stable/7/sys/dev/age/if_age.c	Fri Sep 24 19:31:53 2010	(r213134)
 @@ -1781,6 +1781,7 @@ age_watchdog(struct age_softc *sc)
  	if ((sc->age_flags & AGE_FLAG_LINK) == 0) {
  		if_printf(sc->age_ifp, "watchdog timeout (missed link)\n");
  		ifp->if_oerrors++;
 +		ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  		age_init_locked(sc);
  		return;
  	}
 @@ -1793,6 +1794,7 @@ age_watchdog(struct age_softc *sc)
  	}
  	if_printf(sc->age_ifp, "watchdog timeout\n");
  	ifp->if_oerrors++;
 +	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  	age_init_locked(sc);
  	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
  		taskqueue_enqueue(sc->age_tq, &sc->age_tx_task);
 @@ -1817,8 +1819,10 @@ age_ioctl(struct ifnet *ifp, u_long cmd,
  		else if (ifp->if_mtu != ifr->ifr_mtu) {
  			AGE_LOCK(sc);
  			ifp->if_mtu = ifr->ifr_mtu;
 -			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
 +				ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  				age_init_locked(sc);
 +			}
  			AGE_UNLOCK(sc);
  		}
  		break;
 @@ -2165,6 +2169,7 @@ age_int_task(void *arg, int pending)
  			if ((status & INTR_DMA_WR_TO_RST) != 0)
  				device_printf(sc->age_dev,
  				    "DMA write error! -- resetting\n");
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			age_init_locked(sc);
  		}
  		if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
 @@ -2529,6 +2534,9 @@ age_init_locked(struct age_softc *sc)
  	ifp = sc->age_ifp;
  	mii = device_get_softc(sc->age_miibus);
  
 +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +		return;
 +
  	/*
  	 * Cancel any pending I/O.
  	 */
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Fri,  8 Oct 2010 19:19:57 +0000 (UTC)

 Author: yongari
 Date: Fri Oct  8 19:19:51 2010
 New Revision: 213599
 URL: http://svn.freebsd.org/changeset/base/213599
 
 Log:
   MFC r212968:
     Remove unnecessary controller reinitialization.
   
     PR:	kern/87506
 
 Modified:
   stable/8/sys/dev/ae/if_ae.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/ae/if_ae.c
 ==============================================================================
 --- stable/8/sys/dev/ae/if_ae.c	Fri Oct  8 19:00:36 2010	(r213598)
 +++ stable/8/sys/dev/ae/if_ae.c	Fri Oct  8 19:19:51 2010	(r213599)
 @@ -565,6 +565,8 @@ ae_init_locked(ae_softc_t *sc)
  	AE_LOCK_ASSERT(sc);
  
  	ifp = sc->ifp;
 +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +		return (0);
  	mii = device_get_softc(sc->miibus);
  
  	ae_stop(sc);
 @@ -1786,7 +1788,10 @@ ae_int_task(void *arg, int pending)
  	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
  		if ((val & (AE_ISR_DMAR_TIMEOUT | AE_ISR_DMAW_TIMEOUT |
  		    AE_ISR_PHY_LINKDOWN)) != 0) {
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			ae_init_locked(sc);
 +			AE_UNLOCK(sc);
 +			return;
  		}
  		if ((val & AE_ISR_TX_EVENT) != 0)
  			ae_tx_intr(sc);
 @@ -1997,6 +2002,7 @@ ae_watchdog(ae_softc_t *sc)
  		if_printf(ifp, "watchdog timeout - resetting.\n");
  
  	ifp->if_oerrors++;
 +	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  	ae_init_locked(sc);
  	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
  		taskqueue_enqueue(sc->tq, &sc->tx_task);
 @@ -2107,8 +2113,10 @@ ae_ioctl(struct ifnet *ifp, u_long cmd, 
  		else if (ifp->if_mtu != ifr->ifr_mtu) {
  			AE_LOCK(sc);
  			ifp->if_mtu = ifr->ifr_mtu;
 -			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
 +				ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  				ae_init_locked(sc);
 +			}
  			AE_UNLOCK(sc);
  		}
  		break;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Fri,  8 Oct 2010 19:21:23 +0000 (UTC)

 Author: yongari
 Date: Fri Oct  8 19:21:16 2010
 New Revision: 213600
 URL: http://svn.freebsd.org/changeset/base/213600
 
 Log:
   MFC r212968:
     Remove unnecessary controller reinitialization.
   
     PR:	kern/87506
 
 Modified:
   stable/7/sys/dev/ae/if_ae.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/ae/if_ae.c
 ==============================================================================
 --- stable/7/sys/dev/ae/if_ae.c	Fri Oct  8 19:19:51 2010	(r213599)
 +++ stable/7/sys/dev/ae/if_ae.c	Fri Oct  8 19:21:16 2010	(r213600)
 @@ -565,6 +565,8 @@ ae_init_locked(ae_softc_t *sc)
  	AE_LOCK_ASSERT(sc);
  
  	ifp = sc->ifp;
 +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +		return (0);
  	mii = device_get_softc(sc->miibus);
  
  	ae_stop(sc);
 @@ -1786,7 +1788,10 @@ ae_int_task(void *arg, int pending)
  	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
  		if ((val & (AE_ISR_DMAR_TIMEOUT | AE_ISR_DMAW_TIMEOUT |
  		    AE_ISR_PHY_LINKDOWN)) != 0) {
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			ae_init_locked(sc);
 +			AE_UNLOCK(sc);
 +			return;
  		}
  		if ((val & AE_ISR_TX_EVENT) != 0)
  			ae_tx_intr(sc);
 @@ -1997,6 +2002,7 @@ ae_watchdog(ae_softc_t *sc)
  		if_printf(ifp, "watchdog timeout - resetting.\n");
  
  	ifp->if_oerrors++;
 +	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  	ae_init_locked(sc);
  	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
  		taskqueue_enqueue(sc->tq, &sc->tx_task);
 @@ -2107,8 +2113,10 @@ ae_ioctl(struct ifnet *ifp, u_long cmd, 
  		else if (ifp->if_mtu != ifr->ifr_mtu) {
  			AE_LOCK(sc);
  			ifp->if_mtu = ifr->ifr_mtu;
 -			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
 +				ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  				ae_init_locked(sc);
 +			}
  			AE_UNLOCK(sc);
  		}
  		break;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Fri,  8 Oct 2010 19:27:40 +0000 (UTC)

 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))
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Fri,  8 Oct 2010 19:29:21 +0000 (UTC)

 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))
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Fri,  8 Oct 2010 19:32:46 +0000 (UTC)

 Author: yongari
 Date: Fri Oct  8 19:32:39 2010
 New Revision: 213605
 URL: http://svn.freebsd.org/changeset/base/213605
 
 Log:
   MFC r212972,21300:
   r212972:
     Remove unnecessary controller reinitialization.
   
     PR:	kern/87506
   
   r213000:
     Fix build breakage introduced in r212972.
 
 Modified:
   stable/8/sys/dev/stge/if_stge.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/stge/if_stge.c
 ==============================================================================
 --- stable/8/sys/dev/stge/if_stge.c	Fri Oct  8 19:29:17 2010	(r213604)
 +++ stable/8/sys/dev/stge/if_stge.c	Fri Oct  8 19:32:39 2010	(r213605)
 @@ -1384,6 +1384,7 @@ stge_watchdog(struct stge_softc *sc)
  	ifp = sc->sc_ifp;
  	if_printf(sc->sc_ifp, "device timeout\n");
  	ifp->if_oerrors++;
 +	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  	stge_init_locked(sc);
  	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
  		stge_start_locked(ifp);
 @@ -1412,7 +1413,10 @@ stge_ioctl(struct ifnet *ifp, u_long cmd
  		else if (ifp->if_mtu != ifr->ifr_mtu) {
  			ifp->if_mtu = ifr->ifr_mtu;
  			STGE_LOCK(sc);
 -			stge_init_locked(sc);
 +			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
 +				ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 +				stge_init_locked(sc);
 +			}
  			STGE_UNLOCK(sc);
  		}
  		break;
 @@ -1646,8 +1650,10 @@ stge_intr(void *arg)
  	}
  
  force_init:
 -	if (reinit != 0)
 +	if (reinit != 0) {
 +		ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  		stge_init_locked(sc);
 +	}
  
  	/* Re-enable interrupts. */
  	CSR_WRITE_2(sc, STGE_IntEnable, sc->sc_IntEnable);
 @@ -1943,11 +1949,14 @@ stge_poll(struct ifnet *ifp, enum poll_c
  			if ((status & IS_HostError) != 0) {
  				device_printf(sc->sc_dev,
  				    "Host interface error, resetting...\n");
 +				ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  				stge_init_locked(sc);
  			}
  			if ((status & IS_TxComplete) != 0) {
 -				if (stge_tx_error(sc) != 0)
 +				if (stge_tx_error(sc) != 0) {
 +					ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  					stge_init_locked(sc);
 +				}
  			}
  		}
  
 @@ -2128,6 +2137,8 @@ stge_init_locked(struct stge_softc *sc)
  	STGE_LOCK_ASSERT(sc);
  
  	ifp = sc->sc_ifp;
 +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +		return;
  	mii = device_get_softc(sc->sc_miibus);
  
  	/*
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Fri,  8 Oct 2010 19:34:30 +0000 (UTC)

 Author: yongari
 Date: Fri Oct  8 19:34:23 2010
 New Revision: 213606
 URL: http://svn.freebsd.org/changeset/base/213606
 
 Log:
   MFC r212972,21300:
   r212972:
     Remove unnecessary controller reinitialization.
   
     PR:	kern/87506
   
   r213000:
     Fix build breakage introduced in r212972.
 
 Modified:
   stable/7/sys/dev/stge/if_stge.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/stge/if_stge.c
 ==============================================================================
 --- stable/7/sys/dev/stge/if_stge.c	Fri Oct  8 19:32:39 2010	(r213605)
 +++ stable/7/sys/dev/stge/if_stge.c	Fri Oct  8 19:34:23 2010	(r213606)
 @@ -1386,6 +1386,7 @@ stge_watchdog(struct stge_softc *sc)
  	ifp = sc->sc_ifp;
  	if_printf(sc->sc_ifp, "device timeout\n");
  	ifp->if_oerrors++;
 +	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  	stge_init_locked(sc);
  	if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
  		stge_start_locked(ifp);
 @@ -1414,7 +1415,10 @@ stge_ioctl(struct ifnet *ifp, u_long cmd
  		else if (ifp->if_mtu != ifr->ifr_mtu) {
  			ifp->if_mtu = ifr->ifr_mtu;
  			STGE_LOCK(sc);
 -			stge_init_locked(sc);
 +			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
 +				ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 +				stge_init_locked(sc);
 +			}
  			STGE_UNLOCK(sc);
  		}
  		break;
 @@ -1648,8 +1652,10 @@ stge_intr(void *arg)
  	}
  
  force_init:
 -	if (reinit != 0)
 +	if (reinit != 0) {
 +		ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  		stge_init_locked(sc);
 +	}
  
  	/* Re-enable interrupts. */
  	CSR_WRITE_2(sc, STGE_IntEnable, sc->sc_IntEnable);
 @@ -1940,11 +1946,14 @@ stge_poll(struct ifnet *ifp, enum poll_c
  			if ((status & IS_HostError) != 0) {
  				device_printf(sc->sc_dev,
  				    "Host interface error, resetting...\n");
 +				ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  				stge_init_locked(sc);
  			}
  			if ((status & IS_TxComplete) != 0) {
 -				if (stge_tx_error(sc) != 0)
 +				if (stge_tx_error(sc) != 0) {
 +					ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  					stge_init_locked(sc);
 +				}
  			}
  		}
  
 @@ -2124,6 +2133,8 @@ stge_init_locked(struct stge_softc *sc)
  	STGE_LOCK_ASSERT(sc);
  
  	ifp = sc->sc_ifp;
 +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +		return;
  	mii = device_get_softc(sc->sc_miibus);
  
  	/*
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Fri,  8 Oct 2010 20:43:07 +0000 (UTC)

 Author: yongari
 Date: Fri Oct  8 20:42:59 2010
 New Revision: 213622
 URL: http://svn.freebsd.org/changeset/base/213622
 
 Log:
   MFC r212120:
     Avoid controller reinitialization which could be triggered by
     dhclient(8) or alias addresses are added.
   
     PR:	kern/87506
 
 Modified:
   stable/8/sys/dev/sis/if_sis.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/sis/if_sis.c
 ==============================================================================
 --- stable/8/sys/dev/sis/if_sis.c	Fri Oct  8 20:41:15 2010	(r213621)
 +++ stable/8/sys/dev/sis/if_sis.c	Fri Oct  8 20:42:59 2010	(r213622)
 @@ -1741,6 +1741,7 @@ sis_poll(struct ifnet *ifp, enum poll_cm
  
  		if (status & SIS_ISR_SYSERR) {
  			sis_reset(sc);
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			sis_initl(sc);
  		}
  	}
 @@ -1796,6 +1797,7 @@ sis_intr(void *arg)
  
  		if (status & SIS_ISR_SYSERR) {
  			sis_reset(sc);
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			sis_initl(sc);
  			SIS_UNLOCK(sc);
  			return;
 @@ -1971,6 +1973,9 @@ sis_initl(struct sis_softc *sc)
  
  	SIS_LOCK_ASSERT(sc);
  
 +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +		return;
 +
  	/*
  	 * Cancel pending I/O and free all RX/TX buffers.
  	 */
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87506: commit references a PR
Date: Fri,  8 Oct 2010 20:44:41 +0000 (UTC)

 Author: yongari
 Date: Fri Oct  8 20:44:35 2010
 New Revision: 213623
 URL: http://svn.freebsd.org/changeset/base/213623
 
 Log:
   MFC r212120:
     Avoid controller reinitialization which could be triggered by
     dhclient(8) or alias addresses are added.
   
     PR:	kern/87506
 
 Modified:
   stable/7/sys/dev/sis/if_sis.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/sis/if_sis.c
 ==============================================================================
 --- stable/7/sys/dev/sis/if_sis.c	Fri Oct  8 20:42:59 2010	(r213622)
 +++ stable/7/sys/dev/sis/if_sis.c	Fri Oct  8 20:44:35 2010	(r213623)
 @@ -1738,6 +1738,7 @@ sis_poll(struct ifnet *ifp, enum poll_cm
  
  		if (status & SIS_ISR_SYSERR) {
  			sis_reset(sc);
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			sis_initl(sc);
  		}
  	}
 @@ -1792,6 +1793,7 @@ sis_intr(void *arg)
  
  		if (status & SIS_ISR_SYSERR) {
  			sis_reset(sc);
 +			ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
  			sis_initl(sc);
  			SIS_UNLOCK(sc);
  			return;
 @@ -1967,6 +1969,9 @@ sis_initl(struct sis_softc *sc)
  
  	SIS_LOCK_ASSERT(sc);
  
 +	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 +		return;
 +
  	/*
  	 * Cancel pending I/O and free all RX/TX buffers.
  	 */
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: yongari 
State-Changed-When: Fri Oct 8 23:40:36 UTC 2010 
State-Changed-Why:  
MFC to stable/8 and stable/7 done. 
Thanks for reporting! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87506 
>Unformatted:
