Page MenuHomeFreeBSD

LinuxKPI: pci: fix pcie_get_speed_cap()
ClosedPublic

Authored by bz on Nov 21 2025, 6:00 PM.
Tags
None
Referenced Files
F143374442: D53862.id.diff
Thu, Jan 29, 2:21 PM
F143374437: D53862.id.diff
Thu, Jan 29, 2:21 PM
Unknown Object (File)
Thu, Jan 29, 2:11 AM
Unknown Object (File)
Mon, Jan 26, 2:12 AM
Unknown Object (File)
Thu, Jan 22, 5:39 PM
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
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.Wed, Jan 14, 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! :)