From owner-svn-src-head@freebsd.org Wed Apr 27 16:37:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5628AB1E4A1; Wed, 27 Apr 2016 16:37:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 388E718BD; Wed, 27 Apr 2016 16:37:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1EB63B93A; Wed, 27 Apr 2016 12:37:05 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298710 - head/sys/dev/pci Date: Wed, 27 Apr 2016 09:37 -0700 Message-ID: <2682991.ssHHFcoi01@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201604271634.u3RGYTV4004108@repo.freebsd.org> References: <201604271634.u3RGYTV4004108@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 27 Apr 2016 12:37:05 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 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: Wed, 27 Apr 2016 16:37:06 -0000 On Wednesday, April 27, 2016 04:34:29 PM John Baldwin wrote: > Author: jhb > Date: Wed Apr 27 16:34:29 2016 > New Revision: 298710 > URL: https://svnweb.freebsd.org/changeset/base/298710 > > Log: > Fix PCI bus detach to delete child devices. > > Differential Revision: https://reviews.freebsd.org/D6020 Arguably, bus_generic_detach() should be calling device_delete_children() as most (if not all) buses should delete child devices when detaching, but that's a larger problem to solve. If I had my druthers I'd probably rename bus_generic_detach() to device_detach_children() and change bus_generic_detach() to call device_detach_children() followed by device_delete_children(). Perhaps in 12 we can try to drain that swamp. bus_generic_attach() has similar issues in that a generic bus attach routine should really do what 'bus_generic_probe()' and 'bus_generic_attach()' should do. There is no "generic" probe routine for a bus since a probe routine must set a device description which is unique to the driver. -- John Baldwin