Page MenuHomeFreeBSD

LinuxKPI: pci: fix pcie_get_speed_cap()
ClosedPublic

Authored by bz on Nov 21 2025, 6:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jan 19, 12:04 PM
Unknown Object (File)
Thu, Jan 15, 5:41 PM
Unknown Object (File)
Thu, Jan 15, 8:56 AM
Unknown Object (File)
Sat, Jan 10, 8:25 PM
Unknown Object (File)
Thu, Jan 8, 9:17 AM
Unknown Object (File)
Tue, Jan 6, 12:10 PM
Unknown Object (File)
Mon, Jan 5, 7:16 PM
Unknown Object (File)
Mon, Jan 5, 7:16 PM
Subscribers

Details

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?

Yes let's push this into main and iterate on it from there if necessary

This revision was not accepted when it landed; it landed in state Needs Review.Wed, Jan 14, 6:37 PM
This revision was automatically updated to reflect the committed changes.