HomeFreeBSD

LinuxKPI: pci: implement pci_upstream_bridge()

Description

LinuxKPI: pci: implement pci_upstream_bridge()

Allow drivers to query the "upstream PCI bridge".
Currently we point back to ourselves on pdev->bus->self rather than
to the parent PCI bridge.
We keep this as status-quo with an extra comment and only on-demand
allocate a pci_dev for the parent bridge if we are asked for in
pci_upstream_bridge().
When releasing the pci_dev we check if pdev->bus->self has changed
and call pci_dev_put() to release the reference count on the parent
bridge as well.

This code moves pci_is_root_bus() higher up in pci.h but no functional
change there.

Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky, (jhb some earlier)
Thanks to: wulf for handling drm-kmod
Differential Revision: https://reviews.freebsd.org/D34305

(cherry picked from commit b3b836251f9fefa817d158784189f6d336917f7a)

Details

Provenance
bzAuthored on Feb 16 2022, 6:04 PM
Reviewer
hselasky
Differential Revision
D34305: LinuxKPI: pci: implement pci_upstream_bridge()
Parents
rG8ed3b807ca45: iwlwifi: update man pages
Branches
Unknown
Tags
Unknown