From owner-svn-src-head@FreeBSD.ORG Fri May 8 17:49:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BCA010656D0; Fri, 8 May 2009 17:49:21 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id C02BA8FC13; Fri, 8 May 2009 17:49:20 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id BF70CFF14; Sat, 9 May 2009 05:49:19 +1200 (NZST) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f-s5gh7U6G7r; Sat, 9 May 2009 05:49:14 +1200 (NZST) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Sat, 9 May 2009 05:49:14 +1200 (NZST) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 4DFCA11432; Sat, 9 May 2009 05:49:14 +1200 (NZST) Date: Fri, 8 May 2009 10:49:14 -0700 From: Andrew Thompson To: John Baldwin Message-ID: <20090508174914.GC93351@citylink.fud.org.nz> References: <200905081344.n48DiYJI092605@svn.freebsd.org> <4A046EB0.9060009@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A046EB0.9060009@FreeBSD.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r191912 - in head/sys/dev: ipw iwi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2009 17:49:21 -0000 On Fri, May 08, 2009 at 01:41:04PM -0400, John Baldwin wrote: > Andrew Thompson wrote: >> Author: thompsa >> Date: Fri May 8 13:44:33 2009 >> New Revision: 191912 >> URL: http://svn.freebsd.org/changeset/base/191912 >> >> Log: >> Drain the tasks before the interface stop call in case a restart was queued. > > Actually, you have to drain it after if_detach() so you can safely destroy > the lock. The proper order should be something like this: > > bpfdetach(ifp); > ieee80211_ifdetach(ic); > > ipw_stop(sc); > > callout_drain(); > ieee80211_draintask(); > > ipw_release(sc); > > This is the order other NIC drivers use where they do something like: > > ether_ifdetach(ifp); > FOO_LOCK(sc); > foo_stop(sc); // calls callout_stop() > FOO_UNLOCK(sc); > > callout_drain(); > taskqueue_drain(); // only if it uses tasks > > if_free(); > mtx_destroy(); ieee80211_ifdetach() will actually free the taskqueue, it doesnt use one of the persistent system ones. It wasnt incorrect before as the interface would still be brought down before net80211 detached, it was just to reduce the flip flopping. With that noted does it still need reordering? Andrew