[PATCH] Change the PCI bus driver to free resources leaked by drivers

Brooks Davis brooks at freebsd.org
Tue Jun 25 02:01:47 UTC 2013


On Mon, Jun 24, 2013 at 04:59:14PM -0400, John Baldwin wrote:
> Currently our driver model trusts drivers to DTRT and properly release any 
> resources they allocated during probe() and attach().  I've added a new
> resource_list() helper method to release active resources on a resource
> list and used this to write a pci_child_detached() which cleans up any
> active resources when a device fails to probe or a driver finishes
> detach.  It also fixes an issue where we did not power down devices when
> the driver was detached (e.g. via kldunload).  I've tested the resource
> bits by writing a dummy driver that intentionally attached to an unattached
> device and leaked a memory BAR and verified that the bus warned about the
> leak and cleaned it up.

Looks good in a quick review.

-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-new-bus/attachments/20130624/95e2522c/attachment.sig>


More information about the freebsd-new-bus mailing list