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
F131712645: D12557.diff
Fri, Oct 10, 1:46 PM
Unknown Object (File)
Thu, Oct 9, 6:35 AM
Unknown Object (File)
Fri, Oct 3, 8:53 PM
Unknown Object (File)
Thu, Oct 2, 2:44 AM
Unknown Object (File)
Wed, Oct 1, 6:39 PM
Unknown Object (File)
Tue, Sep 30, 7:16 PM
Unknown Object (File)
Tue, Sep 30, 10:29 AM
Unknown Object (File)
Tue, Sep 30, 6:47 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 11834

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.