[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <184cc562ed8.279b.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com>
Date: Thu, 01 Dec 2022 07:18:32 +0100
From: Arend Van Spriel <arend.vanspriel@...adcom.com>
To: wangyufen <wangyufen@...wei.com>,
Franky Lin <franky.lin@...adcom.com>
CC: <aspriel@...il.com>, <hante.meuleman@...adcom.com>,
<kvalo@...nel.org>, <davem@...emloft.net>,
<linux-wireless@...r.kernel.org>,
<brcm80211-dev-list.pdl@...adcom.com>,
<SHA-cyfmac-dev-list@...ineon.com>, <netdev@...r.kernel.org>,
<arend@...adcom.com>
Subject: Re: [PATCH] wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware()
On December 1, 2022 4:01:39 AM wangyufen <wangyufen@...wei.com> wrote:
> 在 2022/11/30 19:19, Arend van Spriel 写道:
>> On 11/30/2022 3:00 AM, wangyufen wrote:
>>>
>>>
>>> 在 2022/11/30 1:41, Franky Lin 写道:
>>>> On Tue, Nov 29, 2022 at 1:47 AM Wang Yufen <wangyufen@...wei.com> wrote:
>>>>>
>>>>> Fix to return a negative error code -EINVAL instead of 0.
>>>>>
>>>>> Compile tested only.
>>>>>
>>>>> Fixes: d380ebc9b6fb ("brcmfmac: rename chip download functions")
>>>>> Signed-off-by: Wang Yufen <wangyufen@...wei.com>
>>>>> ---
>>>>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 1 +
>>>>> 1 file changed, 1 insertion(+)
>>>>>
>>>>> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>>>>> b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>>>>> index 465d95d..329ec8ac 100644
>>>>> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>>>>> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
>>>>> @@ -3414,6 +3414,7 @@ static int brcmf_sdio_download_firmware(struct
>>>>> brcmf_sdio *bus,
>>>>> /* Take arm out of reset */
>>>>> if (!brcmf_chip_set_active(bus->ci, rstvec)) {
>>>>> brcmf_err("error getting out of ARM core reset\n");
>>>>> + bcmerror = -EINVAL;
>>>>
>>>> ENODEV seems more appropriate here.
>>>
>>> However, if brcmf_chip_set_active() fails in
>>> brcmf_pcie_exit_download_state(), "-EINVAL" is returned.
>>> Is it necessary to keep consistent?
>>
>> If we can not get the ARM on the chip out of reset things will fail soon
>> enough further down the road. Anyway, the other function calls return
>> -EIO so let's do the same here.
>
> So -EIO is better? Anyone else have any other opinions? 😄
Obviously it is no better than -EINVAL when you look at the behavior. It is
just a feeble attempt to be a little bit more consistent. Feel free to
change the return value for brcmf_pcie_exit_download_state() as well.
Regards,
Arend
>>
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4219 bytes)
Powered by blists - more mailing lists