]> git.ipfire.org Git - thirdparty/openwrt.git/commit
airoha: npu: load the firmware without the sysfs fallback 24593/head
authorVitaliy Sochnev <sochnev.v.74@gmail.com>
Fri, 7 Aug 2026 10:09:49 +0000 (11:09 +0100)
committerRobert Marko <robimarko@gmail.com>
Tue, 11 Aug 2026 10:14:23 +0000 (12:14 +0200)
commit3d25753554e7b4dedfc561edb03e635f97854fa6
treee1ae4a473bd20cc15c01e13607ca3423465e3b88
parentab2dc6ab166a97d4e610ce6d1850ab8e66eabdd2
airoha: npu: load the firmware without the sysfs fallback

The NPU driver maps a missing firmware file to -EPROBE_DEFER, so that it
can be retried once the rootfs carrying /lib/firmware is mounted. That
mapping holds only while request_firmware() reports -ENOENT, and it does
not when the sysfs fallback is in play: the request goes to a userspace
helper, blocks for the full 60 second loading_timeout and comes back as
-ETIMEDOUT, which dev_err_probe() then turns into a hard failure. The
board boots a minute slower and ends up with no NPU at all, so no
hardware flow offloading either.

Our own config disables FW_LOADER_USER_HELPER for the target, but that
is not a dependable guard: LEDS_LP55XX_COMMON selects it, so any build
that pulls in kmod-leds-lp55xx-common - every image built with
ALL_KMODS, snapshots included - gets it back, and generic's
FW_LOADER_USER_HELPER_FALLBACK=y then arms the fallback.

Add a patch switching the driver to request_firmware_direct(), which
sets FW_OPT_NOFALLBACK_SYSFS and so reports -ENOENT whatever the
firmware loader is configured to do.

request_firmware_direct() also sets FW_OPT_NO_WARN, so the "Direct
firmware load for airoha/en7581_npu_rv32.bin failed with error -2"
line goes away together with the fallback. There is no variant that
skips the fallback but keeps the warning. While the probe is being
deferred that message was noise, but on a board where the firmware
package is genuinely missing it was the only hint naming the file.

Measured on a Nokia XG-040G-MD with FW_LOADER_USER_HELPER=y and
FW_LOADER_USER_HELPER_FALLBACK=y forced on, the two images differing
only by this patch:

  without:  2.477 fallback -> 64.555 -ETIMEDOUT -> probe failed -110,
            preinit at 69.6s, NPU unbound
  with:     no fallback and no warning at all, NPU fw version 1456.62
            at 3.665s, preinit at 7.6s

Note the fallback is still compiled in and forced in both cases; the
patch does not disable it, it only keeps the driver from falling into
it.

The patch carries Fixes: 23290c7bc190 ("net: airoha: Introduce Airoha
NPU support") and Cc: stable@vger.kernel.org, so it can be dropped once
it lands upstream and reaches us through a stable update.

Link: https://lore.kernel.org/netdev/20260807024125.434055-1-sochnev.v.74@gmail.com/
Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24593
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/airoha/patches-6.18/921-net-airoha-npu-load-firmware-without-the-sysfs-fallb.patch [new file with mode: 0644]