From owner-svn-src-all@FreeBSD.ORG Mon Feb 11 21:12:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BCFF089C; Mon, 11 Feb 2013 21:12:04 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 9AF7FE62; Mon, 11 Feb 2013 21:12:04 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1343BB988; Mon, 11 Feb 2013 16:12:04 -0500 (EST) From: John Baldwin To: Hans Petter Selasky Subject: Re: svn commit: r246614 - head/sys/dev/usb/wlan Date: Mon, 11 Feb 2013 11:33:02 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201302101036.r1AAaHs1022034@svn.freebsd.org> In-Reply-To: <201302101036.r1AAaHs1022034@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201302111133.02161.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 11 Feb 2013 16:12:04 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Feb 2013 21:12:04 -0000 On Sunday, February 10, 2013 5:36:17 am Hans Petter Selasky wrote: > Author: hselasky > Date: Sun Feb 10 10:36:16 2013 > New Revision: 246614 > URL: http://svnweb.freebsd.org/changeset/base/246614 > > Log: > - Streamline detach logic in wlan drivers, so that > freed memory cannot be used during detach. > - Remove all panic() calls from the urtw driver because > panic() is not appropriate here. > - Remove redundant checks for device detached in > device detach callbacks. > - Use DEVMETHOD_END to mark end of device methods. Using a detached flag to bail from ioctl generally means you are doing things wrong in detach. The correct solution is to always detach your ifnet first, then start tearing down other state. In general with device detach routines the first order of business is removing external references such as character devices, ifnets, etc. and only start shutting down the hardware and releasing state once those steps have completed. -- John Baldwin