Page MenuHomeFreeBSD

Convert pci_delete_child() to a bus_child_deleted() method.
ClosedPublic

Authored by jhb on Apr 5 2016, 12:28 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 14, 6:12 AM
Unknown Object (File)
Mon, Apr 14, 3:06 AM
Unknown Object (File)
Mon, Apr 14, 1:54 AM
Unknown Object (File)
Mon, Apr 14, 1:53 AM
Unknown Object (File)
Mar 26 2025, 11:07 AM
Unknown Object (File)
Mar 26 2025, 3:26 AM
Unknown Object (File)
Mar 17 2025, 4:41 PM
Unknown Object (File)
Mar 12 2025, 11:24 AM
Subscribers
None

Details

Summary

Convert pci_delete_child() to a bus_child_deleted() method.

Instead of providing a wrapper around device_delete_child() that the PCI
bus and child bus drivers must call explicitly, move the bulk of the logic
from pci_delete_child() into a bus_child_deleted() method
(pci_child_deleted()). This allows PCI devices to be safely deleted via
device_delete_child().

  • Add a bus_child_deleted method to the ACPI PCI bus which clears the device_t associated with the corresponding ACPI handle in addition to the normal PCI bus cleanup.
  • Change cardbus_detach_card to call device_delete_children() and move CardBus-specific delete logic into a new cardbus_child_deleted() method.
  • Use device_delete_child() instead of pci_delete_child() in the SRIOV code.
  • Add a bus_child_deleted method to the OpenFirmware PCI bus drivers which frees the OpenFirmware device info for each PCI device.

This is a stepping stone as part of the PCI-express hotplug patches.
Note that I have not booted powerpc or sparc64 and am still waiting for
a tinderbox build to complete to verify the ofw changes compile.

Test Plan
  • Tested booting on amd64 and tested insertion and removal of a cardbus adapter.
  • Tested hotplug insertion/removal with out-of-tree PCI-e hotplug patches which tested the ACPI PCI bus case.
  • Tested manual deletion of PCI devices via out-of-tree patches to add a 'devctl delete' command.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3128
Build 3161: arc lint + arc unit

Event Timeline

jhb retitled this revision from to Convert pci_delete_child() to a bus_child_deleted() method..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added reviewers: imp, nwhitehorn, marius.
imp edited edge metadata.

I like this

This revision is now accepted and ready to land.Apr 5 2016, 9:56 PM
This revision was automatically updated to reflect the committed changes.