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
F138335436: D52069.diff
Mon, Dec 1, 3:07 AM
Unknown Object (File)
Fri, Nov 7, 3:45 AM
Unknown Object (File)
Thu, Nov 6, 11:01 PM
Unknown Object (File)
Wed, Nov 5, 11:47 PM
Unknown Object (File)
Oct 16 2025, 8:23 AM
Unknown Object (File)
Oct 12 2025, 5:40 AM
Unknown Object (File)
Oct 10 2025, 9:56 PM
Unknown Object (File)
Oct 10 2025, 9:56 PM
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 Not Applicable
Unit
Tests Not Applicable