Page MenuHomeFreeBSD

LinuxKPI: pci: fix pcie_get_speed_cap()
ClosedPublic

Authored by bz on Nov 21 2025, 6:00 PM.
Tags
None
Referenced Files
F157567598: D53862.id169731.diff
Fri, May 22, 10:16 PM
Unknown Object (File)
Thu, May 21, 2:36 AM
Unknown Object (File)
Wed, May 20, 9:37 PM
Unknown Object (File)
Sat, May 16, 6:27 PM
Unknown Object (File)
Wed, May 6, 7:19 PM
Unknown Object (File)
Tue, May 5, 11:13 PM
Unknown Object (File)
Tue, May 5, 8:29 PM
Unknown Object (File)
Tue, May 5, 5:40 AM
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.Jan 14 2026, 6:37 PM
This revision was automatically updated to reflect the committed changes.
In D53862#1256007, @jhb wrote:

This looks good to me btw.

Thanks! :)