Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Apr 2016 09:37 -0700
From:      John Baldwin <jhb@freebsd.org>
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
Message-ID:  <2682991.ssHHFcoi01@ralph.baldwin.cx>
In-Reply-To: <201604271634.u3RGYTV4004108@repo.freebsd.org>
References:  <201604271634.u3RGYTV4004108@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2682991.ssHHFcoi01>