pcieb speed overrides should check link cap
There are two issues today with the private development ioctls that the
pcieb command and driver expose to set the target link speed on a device:
- To allow the link speed to be set, this requires the link control 2 register, which requires the PCIe cap version 2. This is not being checked right now.
- We aren't verifying that the speed we're requesting is one of the bridges supported speeds. While it's ok to ask for a target speed that a downstream device doesn't support, there's no sense asking for 64 GT/s operation on a device that only supports less than that.
Updated by Robert Mustacchi about 2 months ago
In addition to the basic testing in #14895 which shows how this is now working, here are some examples of this now rejecting unsupported link speeds:
rm@gilgamesh ~ $ pfexec /usr/lib/pci/pcieb /devices//pci@0,0/pci1022,14a7@7,1:devctl Bridge target speed: 32.0 GT/s (gen5) rm@gilgamesh ~ $ pfexec /usr/lib/pci/pcieb -s gen6 /devices//pci@0,0/pci1022,14a7@7,1:devctl pcieb: failed to set target speed: Operation not supported rm@gilgamesh ~ $ pfexec /usr/lib/pci/pcieb -s gen3 /devices/pci@bb,0/pci1022,14aa@5,2:devctl pcieb: failed to set target speed: Operation not supported
Updated by Electric Monk about 1 month ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 8942719269eba26304a9de8478e842928c665dfc Author: Robert Mustacchi <firstname.lastname@example.org> Date: 2022-08-17T18:16:41.000Z 14895 System should report PCIe 32.0 and 64.0 GT/s speeds 14896 pcieb speed overrides should check link cap Reviewed by: Rich Lowe <email@example.com> Reviewed by: Andy Fiddaman <firstname.lastname@example.org> Approved by: Patrick Mooney <email@example.com>