All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware()
@ 2022-11-29 10:07 Wang Yufen
  2022-11-29 17:41 ` Franky Lin
  0 siblings, 1 reply; 8+ messages in thread
From: Wang Yufen @ 2022-11-29 10:07 UTC (permalink / raw)
  To: aspriel, franky.lin, hante.meuleman, kvalo, davem
  Cc: linux-wireless, brcm80211-dev-list.pdl, SHA-cyfmac-dev-list,
	netdev, arend, Wang Yufen

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@huawei.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;
 		goto err;
 	}
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware()
  2022-11-29 10:07 [PATCH] wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware() Wang Yufen
@ 2022-11-29 17:41 ` Franky Lin
  2022-11-30  2:00   ` wangyufen
  0 siblings, 1 reply; 8+ messages in thread
From: Franky Lin @ 2022-11-29 17:41 UTC (permalink / raw)
  To: Wang Yufen
  Cc: aspriel, hante.meuleman, kvalo, davem, linux-wireless,
	brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, netdev, arend

[-- Attachment #1: Type: text/plain, Size: 1065 bytes --]

On Tue, Nov 29, 2022 at 1:47 AM Wang Yufen <wangyufen@huawei.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@huawei.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.

>                 goto err;
>         }
>
> --
> 1.8.3.1
>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4203 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware()
  2022-11-29 17:41 ` Franky Lin
@ 2022-11-30  2:00   ` wangyufen
  2022-11-30 11:19     ` Arend van Spriel
  0 siblings, 1 reply; 8+ messages in thread
From: wangyufen @ 2022-11-30  2:00 UTC (permalink / raw)
  To: Franky Lin
  Cc: aspriel, hante.meuleman, kvalo, davem, linux-wireless,
	brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, netdev, arend



在 2022/11/30 1:41, Franky Lin 写道:
> On Tue, Nov 29, 2022 at 1:47 AM Wang Yufen <wangyufen@huawei.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@huawei.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?

> 
>>                  goto err;
>>          }
>>
>> --
>> 1.8.3.1
>>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware()
  2022-11-30  2:00   ` wangyufen
@ 2022-11-30 11:19     ` Arend van Spriel
  2022-12-01  3:01       ` wangyufen
  0 siblings, 1 reply; 8+ messages in thread
From: Arend van Spriel @ 2022-11-30 11:19 UTC (permalink / raw)
  To: wangyufen, Franky Lin
  Cc: aspriel, hante.meuleman, kvalo, davem, linux-wireless,
	brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, netdev, arend

[-- Attachment #1: Type: text/plain, Size: 1547 bytes --]

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@huawei.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@huawei.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.

Thanks,
Arend

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4219 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware()
  2022-11-30 11:19     ` Arend van Spriel
@ 2022-12-01  3:01       ` wangyufen
  2022-12-01  6:18         ` Arend Van Spriel
  0 siblings, 1 reply; 8+ messages in thread
From: wangyufen @ 2022-12-01  3:01 UTC (permalink / raw)
  To: Arend van Spriel, Franky Lin
  Cc: aspriel, hante.meuleman, kvalo, davem, linux-wireless,
	brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, netdev, arend



在 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@huawei.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@huawei.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? 😄

Thanks,
Wang

> Thanks,
> Arend

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware()
  2022-12-01  3:01       ` wangyufen
@ 2022-12-01  6:18         ` Arend Van Spriel
  2022-12-01 11:16           ` Kalle Valo
  2022-12-02  4:59           ` wangyufen
  0 siblings, 2 replies; 8+ messages in thread
From: Arend Van Spriel @ 2022-12-01  6:18 UTC (permalink / raw)
  To: wangyufen, Franky Lin
  Cc: aspriel, hante.meuleman, kvalo, davem, linux-wireless,
	brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, netdev, arend

[-- Attachment #1: Type: text/plain, Size: 1977 bytes --]

On December 1, 2022 4:01:39 AM wangyufen <wangyufen@huawei.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@huawei.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@huawei.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
>>




[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4219 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware()
  2022-12-01  6:18         ` Arend Van Spriel
@ 2022-12-01 11:16           ` Kalle Valo
  2022-12-02  4:59           ` wangyufen
  1 sibling, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2022-12-01 11:16 UTC (permalink / raw)
  To: Arend Van Spriel
  Cc: wangyufen, Franky Lin, aspriel, hante.meuleman, davem,
	linux-wireless, brcm80211-dev-list.pdl, SHA-cyfmac-dev-list,
	netdev, arend

Arend Van Spriel <arend.vanspriel@broadcom.com> writes:

> On December 1, 2022 4:01:39 AM wangyufen <wangyufen@huawei.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@huawei.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@huawei.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.

Weirdly Arend's last comment is not visible in patchwork:

https://patchwork.kernel.org/project/linux-wireless/patch/1669716458-15327-1-git-send-email-wangyufen@huawei.com/

His last email is visible, but the last paragraph is not shown. Some
strange hiccup somewhere I guess, just wanted to mention it in case we
see more of them.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware()
  2022-12-01  6:18         ` Arend Van Spriel
  2022-12-01 11:16           ` Kalle Valo
@ 2022-12-02  4:59           ` wangyufen
  1 sibling, 0 replies; 8+ messages in thread
From: wangyufen @ 2022-12-02  4:59 UTC (permalink / raw)
  To: Arend Van Spriel, Franky Lin
  Cc: aspriel, hante.meuleman, kvalo, davem, linux-wireless,
	brcm80211-dev-list.pdl, SHA-cyfmac-dev-list, netdev, arend



在 2022/12/1 14:18, Arend Van Spriel 写道:
> On December 1, 2022 4:01:39 AM wangyufen <wangyufen@huawei.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@huawei.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@huawei.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.
> 
All right, I'll send a v2 and change the error return values on both 
sides to -EIO.

Thanks,
Wang
> Regards,
> Arend
>>>
> 
> 
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-12-02  4:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-29 10:07 [PATCH] wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware() Wang Yufen
2022-11-29 17:41 ` Franky Lin
2022-11-30  2:00   ` wangyufen
2022-11-30 11:19     ` Arend van Spriel
2022-12-01  3:01       ` wangyufen
2022-12-01  6:18         ` Arend Van Spriel
2022-12-01 11:16           ` Kalle Valo
2022-12-02  4:59           ` wangyufen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.