From owner-freebsd-arm@FreeBSD.ORG Thu Nov 19 22:01:38 2009 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 069E4106566B for ; Thu, 19 Nov 2009 22:01:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id CB8FB8FC17 for ; Thu, 19 Nov 2009 22:01:37 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 7876246B2C; Thu, 19 Nov 2009 17:01:37 -0500 (EST) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id D90B78A020; Thu, 19 Nov 2009 17:01:36 -0500 (EST) From: John Baldwin To: "M. Warner Losh" Date: Thu, 19 Nov 2009 17:01:33 -0500 User-Agent: KMail/1.9.7 References: <200911191122.02975.jhb@freebsd.org> <20091119.141917.-1843205663.imp@bsdimp.com> In-Reply-To: <20091119.141917.-1843205663.imp@bsdimp.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200911191701.33852.jhb@freebsd.org> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 19 Nov 2009 17:01:36 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: arm@freebsd.org Subject: Re: [PATCH] Fix a few nits in ate(4) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Nov 2009 22:01:38 -0000 On Thursday 19 November 2009 4:19:17 pm M. Warner Losh wrote: > In message: <200911191122.02975.jhb@freebsd.org> > John Baldwin writes: > : @@ -1109,11 +1105,9 @@ > : & (IFF_PROMISC | IFF_ALLMULTI)) != 0) > : ate_rxfilter(sc); > : } else { > : - if ((sc->flags & ATE_FLAG_DETACHING) == 0) > : - ateinit_locked(sc); > : + ateinit_locked(sc); > > Here we reinitialize the device just before we detach it. I put the > detaching stuff in to prevent that. With this change, are you saying > this routine won't be called, so we don't need this check anymore? Basically, yes. More to the point, the previous order of calling atestop() before ether_ifdetach() opened up a race wherein userland (or bpf_detach() within if_detach()) could cause this to get invoked after atestop() had been called. Now that we call ether_ifdetach() first, we know that neither bpf nor userland is going to mess with the device anymore, and at that time we can safely call atestop(). That now removes the need for doing this check. > : } > : } else if ((drv_flags & IFF_DRV_RUNNING) != 0) { > : - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; > : atestop(sc); > : } > : sc->if_flags = flags; > > Why remove this line? I think it is kinda needed. I don't understand. It is a duplicate of the first line of atestop(). -- John Baldwin