Page MenuHomeFreeBSD

gpiobus: use bus_generic_detach when detaching
ClosedPublic

Authored by vexeduxr on Aug 31 2025, 2:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Sep 22, 7:33 AM
Unknown Object (File)
Tue, Sep 8, 12:45 AM
Unknown Object (File)
Mon, Sep 7, 12:54 PM
Unknown Object (File)
Sun, Sep 6, 2:38 PM
Unknown Object (File)
Sat, Sep 5, 8:16 AM
Unknown Object (File)
Fri, Sep 4, 10:35 PM
Unknown Object (File)
Fri, Sep 4, 6:32 PM
Unknown Object (File)
Fri, Sep 4, 6:20 PM
Subscribers
None

Details

Summary

Use bus_generic_detach instead of bus_detach_children so the children
actually get deleted.

Diff Detail

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

Event Timeline

vexeduxr created this revision.

This fixes the BUS_DELETED_CHILD call for acpi_gpiobus. I think it might be papering over a bug though.
When device_delete_child is called, say with device_delete_child(gpio0, gpiobus0), it calls device_detach on gpiobus0. It then goes through it's children and recursively calls device_delete_child on them. When one of these children reach the BUS_CHILD_DELETED call, gpiobus0 has already been detached, so the call never reaches it's implementation.

Sorry I missed this earlier. Please merge into 15.0 if possible.

This revision is now accepted and ready to land.Oct 28 2025, 6:31 PM
In D52305#1219629, @jhb wrote:

Sorry I missed this earlier. Please merge into 15.0 if possible.

NP. Will do.