1113ccc38SLuis R. Rodriguez======================== 2113ccc38SLuis R. RodriguezDirect filesystem lookup 3113ccc38SLuis R. Rodriguez======================== 4113ccc38SLuis R. Rodriguez 5113ccc38SLuis R. RodriguezDirect filesystem lookup is the most common form of firmware lookup performed 6113ccc38SLuis R. Rodriguezby the kernel. The kernel looks for the firmware directly on the root 7113ccc38SLuis R. Rodriguezfilesystem in the paths documented in the section 'Firmware search paths'. 8113ccc38SLuis R. RodriguezThe filesystem lookup is implemented in fw_get_filesystem_firmware(), it 9113ccc38SLuis R. Rodriguezuses common core kernel file loader facility kernel_read_file_from_path(). 10113ccc38SLuis R. RodriguezThe max path allowed is PATH_MAX -- currently this is 4096 characters. 11113ccc38SLuis R. Rodriguez 12113ccc38SLuis R. RodriguezIt is recommended you keep /lib/firmware paths on your root filesystem, 13113ccc38SLuis R. Rodriguezavoid having a separate partition for them in order to avoid possible 14113ccc38SLuis R. Rodriguezraces with lookups and avoid uses of the custom fallback mechanisms 15113ccc38SLuis R. Rodriguezdocumented below. 16113ccc38SLuis R. Rodriguez 17113ccc38SLuis R. RodriguezFirmware and initramfs 18113ccc38SLuis R. Rodriguez---------------------- 19113ccc38SLuis R. Rodriguez 20113ccc38SLuis R. RodriguezDrivers which are built-in to the kernel should have the firmware integrated 21113ccc38SLuis R. Rodriguezalso as part of the initramfs used to boot the kernel given that otherwise 22113ccc38SLuis R. Rodrigueza race is possible with loading the driver and the real rootfs not yet being 23113ccc38SLuis R. Rodriguezavailable. Stuffing the firmware into initramfs resolves this race issue, 24113ccc38SLuis R. Rodriguezhowever note that using initrd does not suffice to address the same race. 25113ccc38SLuis R. Rodriguez 26113ccc38SLuis R. RodriguezThere are circumstances that justify not wanting to include firmware into 27*e2e4e8f5SRandy Dunlapinitramfs, such as dealing with large firmware files for the 28113ccc38SLuis R. Rodriguezremote-proc subsystem. For such cases using a userspace fallback mechanism 29113ccc38SLuis R. Rodriguezis currently the only viable solution as only userspace can know for sure 30113ccc38SLuis R. Rodriguezwhen the real rootfs is ready and mounted. 31