Search Linux Wireless

Re: [PATCH v2] brcmfmac: firmware: Fix firmware loading

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



05.08.2021 12:14, Linus Walleij пишет:
> On Thu, Aug 5, 2021 at 3:22 AM Dmitry Osipenko <digetx@xxxxxxxxx> wrote:
>> 04.08.2021 18:34, Linus Walleij пишет:
>>> +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.

The worker won't call the same function if request_firmware_nowait() fails.



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux