From owner-freebsd-bugs@FreeBSD.ORG Thu Apr 3 21:00:11 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDF051065670 for ; Thu, 3 Apr 2008 21:00:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C3D828FC1C for ; Thu, 3 Apr 2008 21:00:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m33L0Bnq037432 for ; Thu, 3 Apr 2008 21:00:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m33L0BFk037431; Thu, 3 Apr 2008 21:00:11 GMT (envelope-from gnats) Date: Thu, 3 Apr 2008 21:00:11 GMT Message-Id: <200804032100.m33L0BFk037431@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: John Baldwin Cc: Subject: Re: kern/120915: [de] [patch] GENERIC does not boot: if_de is broken X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John Baldwin List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2008 21:00:11 -0000 The following reply was made to PR kern/120915; it has been noted by GNATS. From: John Baldwin To: Peter Much Cc: bug-followup@freebsd.org Subject: Re: kern/120915: [de] [patch] GENERIC does not boot: if_de is broken Date: Thu, 3 Apr 2008 16:53:22 -0400 On Thursday 27 March 2008 07:31:48 pm Peter Much wrote: > On Wed, Mar 26, 2008 at 05:01:24PM -0400, John Baldwin wrote: > ! This patch is a slight variant on the above and other places in the driver use > ! the DEVICEPROBE test to determine if the mediaselect testpacket bit is being > ! done: > > I tested this (still with 6.3-RELEASE-p1), it compiles, but, sorry to > say, this one does panick on attach like before. (I did not yet check > further for reasons like what this DEVICEPROBE value is supposed to > contain.) Try this instead then. It keeps DEVICEPROBE set slightly longer and shouldn't clear it until BPF is fully setup. Index: if_de.c =================================================================== RCS file: /usr/cvs/src/sys/dev/de/if_de.c,v retrieving revision 1.183 diff -u -r1.183 if_de.c --- if_de.c 7 Jun 2007 00:28:47 -0000 1.183 +++ if_de.c 3 Apr 2008 20:51:51 -0000 @@ -4053,7 +4053,8 @@ /* * bounce a copy to the bpf listener, if any. */ - BPF_MTAP(sc->tulip_ifp, m); + if (!(sc->tulip_flags & TULIP_DEVICEPROBE)) + BPF_MTAP(sc->tulip_ifp, m); /* * The descriptors have been filled in. Now get ready @@ -4437,13 +4438,16 @@ ifmedia_init(&sc->tulip_ifmedia, 0, tulip_ifmedia_change, tulip_ifmedia_status); - sc->tulip_flags &= ~TULIP_DEVICEPROBE; tulip_ifmedia_add(sc); tulip_reset(sc); TULIP_UNLOCK(sc); ether_ifattach(sc->tulip_ifp, sc->tulip_enaddr); + + TULIP_LOCK(sc); + sc->tulip_flags &= ~TULIP_DEVICEPROBE; + TULIP_UNLOCK(sc); } /* Release memory for a single descriptor ring. */ -- John Baldwin