HomeFreeBSD

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

Description

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

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 as the cleanup order of
linux_pci_attach_device() needs correction seperately.

Sponsored by: The FreeBSD Foundation (initially)
PR: 283027
PR: 289647
Suggested by: jhb [1]
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52069

(cherry picked from commit bbeeb585315645db20118ef349a4e3dc83b148cc)
(cherry picked from commit 3860afe99ec39b9942967941181f28f27f3fc548)
(cherry picked from commit 123c2dc6e15a62ceba3469caf0f1a6801214a7d3)

Details

Provenance
bzAuthored on Sep 4 2025, 8:22 PM
Reviewer
dumbbell
Differential Revision
D52069: LinuxKPI: pci: allocate entire pci_dev hiereachy up to root port on attach
Parents
rGfd07941961f9: linuxkpi: Move string_helpers.h to string_choices.h
Branches
Unknown
Tags
Unknown