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)
Jan 16 2024, 7:46 AM
Unknown Object (File)
Jan 13 2024, 2:50 AM
Unknown Object (File)
Dec 5 2023, 8:03 AM
Unknown Object (File)
Nov 26 2023, 3:21 AM
Unknown Object (File)
Oct 30 2023, 9:17 AM
Unknown Object (File)
Oct 2 2023, 9:39 PM
Unknown Object (File)
Jun 24 2023, 6:54 AM
Unknown Object (File)
Jun 16 2023, 5:59 AM
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.