pcie_set_target_speed(9)
π pcie_set_target_speed β like, the Kernel API Manual, but make it make sense
okay so bestie, welcome to pcie_set_target_speed(9) β yes that (9) means it's a kernel API page, we're in the deep end of the pool today and honestly? we're thriving π«Ά
This is the little function that tells a PCIe Port "hey, go faster" (or slower, no judgement) and then actually waits around to see if the link training worked. Very main character energy. Let's get into it β¨
πΈ NAME πΈ
pcie_set_target_speed β Set downstream Link Speed for PCIe Port
That's it. That's the whole vibe. It sets the Link Speed. For a port. Downstream. Periodt π
β SYNOPSIS β
int pcie_set_target_speed (struct pci_dev *port , enum pci_bus_speed
speed_req , bool use_lt );
Like, three things go in, an int comes out. That's the whole transaction, no cap π
π¦ DESCRIPTION π¦
So here's the tea, bestie: this function attempts to set the PCIe Port Link Speed to speed_req.
And it's giving "I'll try my best" energy, because β and this is important, don't miss it β speed_req may be adjusted downwards to the best speed supported by both the Port and the PCIe Device underneath it. So you might ask for the speed of light and get a polite compromise instead π The port and the device have to agree, that's the whole point.
ngl β the word "attempt" is doing a lot of heavy lifting in that sentence. Read it again. They said attempt. π«Ά
π ARGUMENTS π
portβ the PCIe Port. That's the thing you're controlling, the whole reason you're here, the star of the show πspeed_reqβ the Requested PCIe Link Speed. What you want. Whether you get it is another matter entirely (see DESCRIPTION, see also: life).use_ltβ aboolthat says: wait for theLTorDLLLAbit to detect the end of link training. So like, do we actually sit here and monitor the training bits, or do we just fire and forget? That's the question this little boolean is asking π
π RETURN π
The return values, ranked, with feelings:
0β on success. Slay. It worked. Iconic behaviour β¨-EINVALβspeed_reqis not a PCIe Link Speed. Bestie. That's not a speed. Read the enum π-ENODEVβportis not controllable. The port said "not today" and honestly we respect the boundaries π-ETIMEDOUTβ changing Link Speed took too long. It's giving "the server is thinkingβ¦" forever πΈ-EAGAINβ Link Speed was changed butspeed_reqwas not achieved. So it moved! Just not to where you asked. A for effort, lowkey π₯
π§ SEE ALSO π§
- Kernel file
./drivers/pci/pcie/bwctrl.cβ go read the source, iykyk struct pcie_bwctrl_data(9)β the struct itself, the blueprint, the lorepcie_bwctrl_select_speed(9)β the cousin that picks a speed, which is kind of a whole mood too
and that's the page!! πβ¨ππ¦πΈπ π«Ά
this absolute gem came out of ./drivers/pci/pcie and it's dated October 2026, so likeβ¦ mark your calendars bestie, the future is calling and it wants a faster link speed πβ
no notes. 10/10. go set some target speeds, you've got this π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms