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)
Thu, Aug 13, 5:40 AM
Unknown Object (File)
Sun, Aug 9, 3:28 PM
Unknown Object (File)
Sun, Aug 9, 3:28 PM
Unknown Object (File)
Sun, Aug 9, 3:27 PM
Unknown Object (File)
Tue, Aug 4, 9:47 AM
Unknown Object (File)
Tue, Aug 4, 7:59 AM
Unknown Object (File)
Mon, Aug 3, 9:00 AM
Unknown Object (File)
Sat, Jul 25, 12:47 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.