Page MenuHomeFreeBSD

LinuxKPI: pci: fix pcie_get_speed_cap()
Needs ReviewPublic

Authored by bz on Nov 21 2025, 6:00 PM.
Tags
None
Referenced Files
F141434889: D53862.id166920.diff
Mon, Jan 5, 7:16 PM
F141434882: D53862.id.diff
Mon, Jan 5, 7:16 PM
F141406370: D53862.diff
Mon, Jan 5, 9:00 AM
F141386518: D53862.diff
Mon, Jan 5, 1:36 AM
Unknown Object (File)
Sun, Jan 4, 9:31 AM
Unknown Object (File)
Fri, Jan 2, 7:47 PM
Unknown Object (File)
Wed, Dec 24, 10:19 AM
Unknown Object (File)
Fri, Dec 19, 10:06 AM
Subscribers

Details

Reviewers
emaste
dumbbell
Summary

pcie_get_speed_cap() has a hard coded skip of 3 devices at the
beginning. It is either called on a pdev or on a result from
pci_upstream_bridge(). In the latter case skipping another three
devices might get us to acpi0 or nexus, neither of which is a
PCI device still and pci_get_vendor() will panic() on that.

MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 68788
Build 65671: arc lint + arc unit

Event Timeline

bz requested review of this revision.Nov 21 2025, 6:00 PM

I've applied this to my local tree for testing

I've run with this since Sep 17 apparently even though my amdgpu was only useable for ~4 weeks during that time frame.

@emaste should I just put this into main and stable/15 and we'll see?

Also @jhb from looking at the code, on which PCI devices should it be called? I am still confused by the (original) naming of "root". I would assume it's supposedly called on a pcib. Is that correct?