Page MenuHomeFreeBSD

LinuxKPI: pci: fix pcie_get_speed_cap()
ClosedPublic

Authored by bz on Nov 21 2025, 6:00 PM.
Tags
None
Referenced Files
F151645982: D53862.id.diff
Thu, Apr 9, 6:17 PM
Unknown Object (File)
Thu, Apr 9, 7:04 AM
Unknown Object (File)
Tue, Apr 7, 3:27 PM
Unknown Object (File)
Mon, Apr 6, 6:24 PM
Unknown Object (File)
Fri, Mar 27, 3:13 AM
Unknown Object (File)
Sat, Mar 21, 4:52 AM
Unknown Object (File)
Fri, Mar 20, 7:58 PM
Unknown Object (File)
Wed, Mar 18, 1:54 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 Not Applicable
Unit
Tests Not Applicable

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! :)