From owner-svn-src-head@FreeBSD.ORG Mon Aug 13 19:46:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 15DE4106564A; Mon, 13 Aug 2012 19:46:54 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe02.c2i.net [212.247.154.34]) by mx1.freebsd.org (Postfix) with ESMTP id E4C618FC08; Mon, 13 Aug 2012 19:46:51 +0000 (UTC) X-T2-Spam-Status: No, hits=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 Received: from [176.74.212.201] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe02.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 308238900; Mon, 13 Aug 2012 21:46:49 +0200 From: Hans Petter Selasky To: John Baldwin Date: Mon, 13 Aug 2012 21:47:24 +0200 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <201208101502.q7AF2ofC046316@svn.freebsd.org> <201208130949.07399.jhb@freebsd.org> In-Reply-To: <201208130949.07399.jhb@freebsd.org> X-Face: 'mmZ:T{)),Oru^0c+/}w'`gU1$ubmG?lp!=R4Wy\ELYo2)@'UZ24N@d2+AyewRX}mAm; Yp |U[@, _z/([?1bCfM{_"B<.J>mICJCHAzzGHI{y7{%JVz%R~yJHIji`y>Y}k1C4TfysrsUI -%GU9V5]iUZF&nRn9mJ'?&>O MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201208132147.24769.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r239178 - in head/sys: kern sys 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: Mon, 13 Aug 2012 19:46:54 -0000 On Monday 13 August 2012 15:49:07 John Baldwin wrote: > On Friday, August 10, 2012 11:02:50 am Hans Petter Selasky wrote: > > Author: hselasky > > Date: Fri Aug 10 15:02:49 2012 > > New Revision: 239178 > > URL: http://svn.freebsd.org/changeset/base/239178 > > > > Log: > > Add new device method to free the automatically > > allocated softc structure which is returned by > > device_get_softc(). This method can be used to > > easily implement softc refcounting. This can be > > desirable when the softc has memory references > > which are controlled by userspace handles for > > example. > > Why do you need a new method? If you want to manage your own softc, you > are free to do so by using a size of 0 in your driver_t. You can then use > device_set_softc() to set the softc during your attach routine. New-bus > won't free it during detach leaving you to free it instead. That is what > you should have done here instead of polluting device_if.m. Note that > DF_EXTERNALSOFTC is an internal flag to explicitly handle this case, but > you've now made it possible for a device to try to do special free logic > but haven't made DF_EXTERNALSOFTC visible to that driver. This is why I > think new-bus already let you do what you wanted (via device_set_softc()) > and think you should just do that and back this out. Hi, I don't need to pollute device_if.m. Would device_steal_softc() be OK, to say that we want newbus to allocate the softc, but not free it? Thanks for your comments. --HPS