pci_cfg_access_trylock(9)
β¨ pci_cfg_access_trylock(9) β¨
okay bestie, welcome to the pci_cfg_access_trylock(9) page from the Kernel API Manual β this one's short and sweet and honestly kind of a vibe π
π NAME π
pci_cfg_access_trylock β the "try" version of locking PCI config reads/writes. like, she attempts. she does not wait. π
πΈ SYNOPSIS πΈ
bool pci_cfg_access_trylock (struct pci_dev *dev );
π¦ ARGUMENTS π¦
devβ the pci device struct π«Ά this is your pci device, the one you're trying to get at
β DESCRIPTION β
okay so literally, pci_cfg_access_trylock does the same thing as pci_cfg_access_lock β no cap β but with a twist: it returns 0 if access is already locked, and 1 otherwise. that's it. that's the whole personality π§
the glowing part? this function can be used from atomic contexts π₯ which is genuinely iconic of her, because regular lock-waiting is a big nope in atomic context.
lowkey the whole point: she tries, she tells you yes or no, she never blocks. if she says 0, don't just stand there β that access is taken, bestie π
π SEE ALSO π
- Kernel file
./drivers/pci/access.cβ the source, go read her pci_bus_set_ops(9)pci_cfg_access_lock(9)pci_cfg_access_unlock(9)
those last two are her siblings β the lock and the unlock β and honestly you should know all three, iykyk π
anyway that's the page π it lives over in ./drivers/pci, dated October 2026, and yes the manual is literally called pci_cfg_access_trylock(9) so we came full circle, periodt πβ¨
π¦ 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