Page MenuHomeFreeBSD

pci: pci_host_generic: provide cleanup methods outside of detach
ClosedPublic

Authored by kevans on May 9 2026, 2:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Aug 26, 3:19 AM
Unknown Object (File)
Fri, Aug 21, 4:32 AM
Unknown Object (File)
Thu, Aug 20, 5:47 PM
Unknown Object (File)
Wed, Aug 19, 6:23 PM
Unknown Object (File)
Wed, Aug 19, 5:49 PM
Unknown Object (File)
Mon, Aug 17, 10:39 PM
Unknown Object (File)
Wed, Aug 12, 6:16 AM
Unknown Object (File)
Sun, Aug 9, 3:56 AM
Subscribers

Details

Summary

If device_attach() fails, we're expected to actually cleanup after
ourselves because device_detach() will not be called. Factor out the
cleanup bits that don't rely on attach having actually succeeded so
that we can cleanup properly in bcm2838_pci.

Diff Detail

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

Event Timeline

kevans requested review of this revision.May 9 2026, 2:59 AM

looks good, not sure why free vs destroy though

sys/dev/pci/pci_host_generic_fdt.c
108

why the naming difference?

sys/dev/pci/pci_host_generic_fdt.c
108

Maybe silly, but destroy here to better parallel the setup verbiage and to match ofw_bus_gen_destroy_devinfo. I would've named it free if we had used alloc or nothing at all (i.e. just part of attach).

This revision is now accepted and ready to land.May 11 2026, 10:54 PM