pci_resize_resource(9)
π pci_resize_resource(9) β the kernel API manual, but make it cute β¨
okay so bestie, welcome to the glow-up era of pci_resize_resource(9) β this is the page from the Kernel API Manual and it's literally about reconfiguring a Resizable BAR and its resources. no cap, it's giving main character energy for your PCI device π
β¨ SYNOPSIS β¨
int pci_resize_resource (struct pci_dev *dev , int resno , int size ,
int exclude_bars );
like, that's the whole vibe. one function, four args, let's go π«Ά
πΈ ARGUMENTS πΈ
devβ the PCI device π the actual star of the show.resnoβ index of the BAR to be resized β¨ pick your fighter.sizeβ new size as defined in the spec (0=1MB, 31=128TB) π iconic range honestly, from smol to absolutely massive.exclude_barsβ a mask of BARs that should not be released π hands off these ones.
π¦ DESCRIPTION π¦
So here's the tea: this reconfigures resno to size and re-runs the resource assignment algorithm with the new size. it's giving "makeover montage" π₯
Prior to resize, release dev resources that share a bridge window with resno. this unpins the bridge window resource to allow changing it β lowkey necessary, you gotta let it breathe π
The caller may prevent releasing a particular BAR by providing exclude_bars mask, but this may result in the resize operation failing due to insufficient space. π so yeah, protect a BAR and you might run out of room. choices were made.
β RETURN β
0 on success, or negative on error π and ngl, in case of an error, the resources are restored to their original places β so it puts everything back where it found it, we love a clean exit β¨
π SEE ALSO π
Kernel file ./drivers/pci/rebar.c plus the whole rebar bestie squad:
pci_rebar_bytes_to_size(9)pci_rebar_size_to_bytes(9)pci_rebar_find_pos(9)pci_rebar_get_possible_sizes(9)pci_rebar_size_supported(9)pci_rebar_get_max_size(9)pci_rebar_get_current_size(9)pci_rebar_set_size(9)
and that's the whole page, bestie πβ¨ this iconic little manual lives in ./drivers/pci, dated October 2026 β mwah, 10/10, no notes πππ§π
π¦ 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