cache_firmware(9)
β¨ cache_firmware(9) β¨
okay so first things first, bestie β this page is from the Kernel API Manual, and it's literally just one little function that does one big mood: it caches a firmware image in kernel memory space. that's the whole name, no cap: cache_firmware. π
πΈ NAME πΈ
cache_firmware β cache one firmware image in kernel memory space πΎβ¨
π¦ SYNOPSIS π¦
int cache_firmware (const char *fw_name );
likeβ¦ that's it. that's the whole vibe check. one argument, one int coming back at you. π«Ά
π ARGUMENTS π
fw_nameβ the firmware image name. literally the name of the firmware image, that's the whole thing she needs from you. π
π₯ DESCRIPTION π₯
okay so here's the tea. cache_firmware caches the firmware in kernel memory so that drivers can use it at a time when the system isn't ready for them to request a firmware image from userspace. like, the driver wants it now but the system is giving "not yet bestie" energy, and this is the fix. π
once it returns successfully, the driver can use request_firmware or its nowait version to get the cached firmware without any interacting with userspace at all. no back-and-forth, no waiting around, just grab and go. main character behaviour honestly. π
as for what you get back:
- it returns
0if the firmware image has been cached successfully β - it returns
!0otherwise π
so like, 0 is the slay, !0 is the "hmm". keep an eye on that return value, fr fr.
β SEE ALSO β
the gang's all here, and you will be clicking through all of them, iykyk:
- Kernel file
./drivers/base/firmware_loader/main.c request_firmware(9)firmware_request_nowarn(9)request_firmware_direct(9)firmware_request_platform(9)firmware_request_cache(9)request_firmware_into_buf(9)request_partial_firmware_into_buf(9)release_firmware(9)request_firmware_nowait(9)firmware_request_nowait_nowarn(9)request_firmware_nowait_cancel(9)uncache_firmware(9)device_cache_fw_images(9)device_uncache_fw_images(9)device_uncache_fw_images_delay(9)
ngl the !0 return is doing the most, but that's exactly what the page says and we respect it. π
π and that's the whole page, bestie! this little gem lives under ./drivers/base/firmware_loader and the version is dated October 2026 β go forth and cache responsibly. mwah. πππ¦
π¦ 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