Re: [PATCH v2] brcmfmac: firmware: Fix firmware loading
From: Linus Walleij <hidden>
Date: 2021-08-05 09:14:55
On Thu, Aug 5, 2021 at 3:22 AM Dmitry Osipenko [off-list ref] wrote:
04.08.2021 18:34, Linus Walleij пишет:quoted
+static void brcmf_fw_request_done_first(const struct firmware *fw, void *ctx) { struct brcmf_fw *fwctx = ctx; + struct brcmf_fw_item *first = &fwctx->req->items[0]; int ret; + /* Something failed with the first firmware request, such as not + * getting the per-board firmware. Retry this, now using the less + * specific path for the first firmware item, i.e. without the board + * suffix. + */ + if (!fw && !fwctx->tested_board_variant) { + fwctx->tested_board_variant = true; + ret = request_firmware_nowait(THIS_MODULE, true, first->path, + fwctx->dev, GFP_KERNEL, fwctx, + brcmf_fw_request_done_first); + return;The original code was proceeding on error. Is this a typo here?
No, we are testing specifically for fw being NULL and in that case we issue a new request_firmware_nowait() call with ourselves as "done" callback, so we really need to return here. The worker will call the same function again after this but now tested_board_variant is true. Yours, Linus Walleij