R8152 usb ethernet driver doesnt load firmware file even though it exists

I have build a custom x86 openwrt and use a r8152 usb ethernet device. However when the device is loaded i always get this error:

[94548.914215] usb 2-2: reset SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[94548.957508] r8152 2-2:1.0: unable to load firmware patch rtl_nic/rtl8153a-4.fw (-2)
[94549.004994] r8152 2-2:1.0 eth2: v1.11.11

and I cannot get it to load the firmware.

here is the firmware file:

root@OpenWrt:~# ls -l /lib/firmware/rtl_nic/
-rw-r--r--    1 root     root          2076 Sep 14 02:36 rtl8105e-1.fw
-rw-r--r--    1 root     root          1856 Sep 14 02:36 rtl8106e-1.fw
-rw-r--r--    1 root     root           832 Sep 14 02:36 rtl8106e-2.fw
-rw-r--r--    1 root     root           992 Sep 14 02:36 rtl8107e-1.fw
-rw-r--r--    1 root     root           976 Sep 14 02:36 rtl8107e-2.fw
-rw-r--r--    1 root     root          3456 Sep 14 02:36 rtl8125a-3.fw
-rw-r--r--    1 root     root         10128 Sep 14 02:36 rtl8125b-1.fw
-rw-r--r--    1 root     root          3328 Sep 14 02:36 rtl8125b-2.fw
-rw-r--r--    1 root     root          1768 Sep 14 02:36 rtl8153a-2.fw
-rw-r--r--    1 root     root          1440 Sep 14 02:36 rtl8153a-3.fw
-rw-r--r--    1 root     root           712 Sep 14 02:36 rtl8153a-4.fw
-rw-r--r--    1 root     root          1088 Sep 14 02:36 rtl8153b-2.fw
-rw-r--r--    1 root     root           816 Sep 14 02:36 rtl8153c-1.fw
-rw-r--r--    1 root     root          3816 Sep 14 02:36 rtl8156a-2.fw
-rw-r--r--    1 root     root          5448 Sep 14 02:36 rtl8156b-2.fw
-rw-r--r--    1 root     root          1492 Sep 14 02:36 rtl8168d-1.fw
-rw-r--r--    1 root     root          1324 Sep 14 02:36 rtl8168d-2.fw
-rw-r--r--    1 root     root          5500 Sep 14 02:36 rtl8168e-1.fw
-rw-r--r--    1 root     root          3920 Sep 14 02:36 rtl8168e-2.fw
-rw-r--r--    1 root     root          3872 Sep 14 02:36 rtl8168e-3.fw
-rw-r--r--    1 root     root          3424 Sep 14 02:36 rtl8168f-1.fw
-rw-r--r--    1 root     root          1232 Sep 14 02:36 rtl8168f-2.fw
-rw-r--r--    1 root     root           336 Sep 14 02:36 rtl8168fp-3.fw
-rw-r--r--    1 root     root          4304 Sep 14 02:36 rtl8168g-1.fw
-rw-r--r--    1 root     root          4896 Sep 14 02:36 rtl8168g-2.fw
-rw-r--r--    1 root     root           832 Sep 14 02:36 rtl8168g-3.fw
-rw-r--r--    1 root     root           992 Sep 14 02:36 rtl8168h-1.fw
-rw-r--r--    1 root     root           976 Sep 14 02:36 rtl8168h-2.fw
-rw-r--r--    1 root     root          1824 Sep 14 02:36 rtl8402-1.fw
-rw-r--r--    1 root     root          2112 Sep 14 02:36 rtl8411-1.fw
-rw-r--r--    1 root     root          1040 Sep 14 02:36 rtl8411-2.fw

as you can see, it is clearly in the filesystem at /lib/firmware and that is what i think is the correct location for the firmware. why does the kernel module not load this firmware? the error of -2 typically means the file is not found...

has anyone run into this issue? is there a resolution?

assuming the path isn't cut off in the error message, it might be looking in the wrong dir.

If your build is based on kernel 5.10 you need to install kmod-crypto-sha256 to properly load the firmware.

thank you. i am using 5.10 and i knew someone would know how to fix it. could you also tell me how come this is the case?

I was added with this upstream commit https://github.com/torvalds/linux/commit/9370f2d05a2a150b0aa719a3070b26d478180df3 line 3527

1 Like

thanks i get it now. I thought you meant it somehow applied to all firmware loading on the kernel. looks like theres a dependency but it was not brought through from kernel makefiles to the openwrt build w/respect to the additional firmware (incidentally part of the r8169 firmware package)