]> git.baikalelectronics.ru Git - kernel.git/commit
brcmfmac: firmware: Fix firmware loading
authorLinus Walleij <linus.walleij@linaro.org>
Sun, 8 Aug 2021 18:05:10 +0000 (21:05 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Sat, 21 Aug 2021 15:45:30 +0000 (18:45 +0300)
commit8e901c0f27cd30fbae7416a6e1d5afb51cb5d937
treeb9d11d16da09a5385de389e86f04c725895a5cad
parent8f3da3d568ba75cff1816deb476c581e7ca90743
brcmfmac: firmware: Fix firmware loading

The patch that would first try the board-specific firmware
had a bug because the fallback would not be called: the
asynchronous interface is used meaning request_firmware_nowait()
returns 0 immediately.

Harden the firmware loading like this:

- If we cannot build an alt_path (like if no board_type is
  specified) just request the first firmware without any
  suffix, like in the past.

- If the lookup of a board specific firmware fails, we get
  a NULL fw in the async callback, so just try again without
  the alt_path from a dedicated brcm_fw_request_done_alt_path
  callback.

- Drop the unnecessary prototype of brcm_fw_request_done.

- Added MODULE_FIRMWARE match for per-board SDIO bins, making
  userspace tools to pull all the relevant firmware files.

Fixes: 0ad61bbf4436 ("brcmfmac: firmware: Allow per-board firmware binaries")
Cc: Stefan Hansson <newbyte@disroot.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210808180510.8753-1-digetx@gmail.com
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c