Page MenuHomeFreeBSD

Add eventhandler notifications for newbus device attach/detach.
ClosedPublic

Authored by ian on Oct 1 2017, 6:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 2, 7:22 AM
Unknown Object (File)
Oct 24 2024, 2:56 AM
Unknown Object (File)
Oct 4 2024, 1:31 AM
Unknown Object (File)
Oct 2 2024, 11:25 PM
Unknown Object (File)
Sep 30 2024, 9:44 AM
Unknown Object (File)
Sep 24 2024, 9:17 AM
Unknown Object (File)
Sep 23 2024, 8:12 AM
Unknown Object (File)
Sep 21 2024, 12:44 PM
Subscribers

Details

Summary

The detach case is slightly complicated by the fact that some in-kernel consumers may want to know before a device detaches (so they can release related resources, stop using the device, etc), but the detach can fail. So there are pre- and post-detach notifications for those consumers who need to handle all cases.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Note that in the current newbus locking model, DETACH_BEGIN and DETACH_COMPLETE/FAILED sequence of event handler invocation might interweave with other attach/detach events arbitrary. The handlers should be prepared for such situations.

This revision is now accepted and ready to land.Oct 1 2017, 7:00 PM

Is there a suitable man page to put the protocol on?

Otherwise lgtm.

Also should note that detach may be called after the parent bus knows the hardware has left the building. In-kernel consumers have to be prepared to cope with this race...

This revision was automatically updated to reflect the committed changes.