Page MenuHomeFreeBSD

bus_generic_detach: Delete children after detaching them
AcceptedPublic

Authored by jhb on Fri, Dec 6, 10:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 11, 8:59 AM
Unknown Object (File)
Sun, Dec 8, 5:22 PM
Subscribers

Details

Reviewers
imp
andrew
Summary

This provides better semantics as a standalone DEVMETHOD for
device_attach as bus drivers should remove child devices they created
as part of detach cleanup. The implementation calls
bus_detach_children() first to permit child devices an opportunity to
veto the detach operation. If that succeeds, device_delete_children()
is used to delete the child devices.

This requires fixing various drivers that were deleting devices
explicitly (via a device_t pointer cached in the softc) after calling
bus_generic_detach to stop doing that and just rely on
bus_generic_detach to remove child devices.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 61000
Build 57884: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Fri, Dec 6, 10:30 PM
jhb added a subscriber: bz.

I will bump __FreeBSD_version as well in this commit.

This revision is now accepted and ready to land.Sat, Dec 7, 4:23 PM

We have no manpages for this stuff. :( I've thought about writing a new manpage for bus_*_children and maybe some manpages for bus_generic_* (similar to the breakout I used on the slides for my talk in Dublin).

In D47959#1093747, @jhb wrote:

We have no manpages for this stuff. :( I've thought about writing a new manpage for bus_*_children and maybe some manpages for bus_generic_* (similar to the breakout I used on the slides for my talk in Dublin).

That would be great. I'm cool with vague future promises..