Page MenuHomeFreeBSD

LinuxKPI: pci: allocate entire pci_dev hiereachy up to root port on attach
ClosedPublic

Authored by bz on Aug 21 2025, 8:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 4, 4:07 PM
Unknown Object (File)
Fri, Apr 3, 9:40 PM
Unknown Object (File)
Sun, Mar 15, 8:23 PM
Unknown Object (File)
Fri, Mar 13, 3:45 PM
Unknown Object (File)
Thu, Mar 12, 12:32 AM
Unknown Object (File)
Fri, Mar 6, 8:06 PM
Unknown Object (File)
Mar 6 2026, 12:32 AM
Unknown Object (File)
Feb 21 2026, 5:18 AM
Subscribers

Details

Summary

In linux_pci_attach_device() allocate a LinuxKPI pci_dev for each device in
the hierarchy up to the root port[1] as we cannot do that later on demand
as we may be in a context where we may not sleep.

Take special care of DRM as there is a non-PCI device in the chain which
needs to be skipped.

iwlwifi(4) can hit this case called from a callout.

While here leave a comment sa the cleanup order of
linux_pci_attach_device() needs correction seperately.

Sponsored by: The FreeBSD Foundation
PR: 283027
Suggested by: jhb [1]
MFC after: 3 days

Diff Detail

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

Event Timeline

bz requested review of this revision.Aug 21 2025, 8:59 AM
This revision is now accepted and ready to land.Sep 3 2025, 8:36 PM