* [PATCH] wifi: mwifiex: added extra delay for firmware ready.
@ 2023-11-28 8:25 David Lin
2023-12-05 20:00 ` Francesco Dolcini
2023-12-05 20:26 ` Brian Norris
0 siblings, 2 replies; 5+ messages in thread
From: David Lin @ 2023-11-28 8:25 UTC (permalink / raw)
To: linux-wireless
Cc: linux-kernel, briannorris, kvalo, francesco, tsung-hsien.hsieh,
David Lin
For SDIO IW416, in a corner case FW may return ready before complete full
initialization.
Command timeout may occur at driver load after reboot.
Workaround by adding 100ms delay at checking FW status.
Signed-off-by: David Lin <yu-hao.lin@nxp.com>
---
drivers/net/wireless/marvell/mwifiex/sdio.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index 6462a0ffe698..744e9403430a 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -783,6 +783,9 @@ static int mwifiex_check_fw_status(struct mwifiex_adapter *adapter,
ret = -1;
}
+ if (!ret)
+ msleep(100);
+
return ret;
}
base-commit: 783004b6dbda2cfe9a552a4cc9c1d168a2068f6c
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] wifi: mwifiex: added extra delay for firmware ready.
2023-11-28 8:25 [PATCH] wifi: mwifiex: added extra delay for firmware ready David Lin
@ 2023-12-05 20:00 ` Francesco Dolcini
2023-12-06 1:53 ` [EXT] " David Lin
2023-12-05 20:26 ` Brian Norris
1 sibling, 1 reply; 5+ messages in thread
From: Francesco Dolcini @ 2023-12-05 20:00 UTC (permalink / raw)
To: David Lin
Cc: linux-wireless, linux-kernel, briannorris, kvalo, francesco,
tsung-hsien.hsieh
Hello David,
thanks for your patch. Planning to run some test on this over the next
days and we'll provide some actual feedback if this really solves the
issue we are affected by.
Just a couple of nitpicky comments on the actual patch.
On the commit message you should use imperative mood, e.g.
`wifi: mwifiex: add extra delay for firmware ready`
with no period at the end of the line.
On Tue, Nov 28, 2023 at 04:25:44PM +0800, David Lin wrote:
> For SDIO IW416, in a corner case FW may return ready before complete full
> initialization.
> Command timeout may occur at driver load after reboot.
> Workaround by adding 100ms delay at checking FW status.
>
> Signed-off-by: David Lin <yu-hao.lin@nxp.com>
Add
Cc: stable@...
> ---
> drivers/net/wireless/marvell/mwifiex/sdio.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
> index 6462a0ffe698..744e9403430a 100644
> --- a/drivers/net/wireless/marvell/mwifiex/sdio.c
> +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
> @@ -783,6 +783,9 @@ static int mwifiex_check_fw_status(struct mwifiex_adapter *adapter,
> ret = -1;
> }
>
> + if (!ret)
> + msleep(100);
> +
you could just add the delay after
if (firmware_stat == FIRMWARE_READY_SDIO) {
this would be more read-able to me. Adding also a short comment like
/* Firmware might pretend to be ready, when it's not.
* Wait a little bit more as a workaround */
Francesco
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] wifi: mwifiex: added extra delay for firmware ready.
2023-11-28 8:25 [PATCH] wifi: mwifiex: added extra delay for firmware ready David Lin
2023-12-05 20:00 ` Francesco Dolcini
@ 2023-12-05 20:26 ` Brian Norris
2023-12-06 2:19 ` [EXT] " David Lin
1 sibling, 1 reply; 5+ messages in thread
From: Brian Norris @ 2023-12-05 20:26 UTC (permalink / raw)
To: David Lin
Cc: linux-wireless, linux-kernel, kvalo, francesco, tsung-hsien.hsieh
On Tue, Nov 28, 2023 at 04:25:44PM +0800, David Lin wrote:
> For SDIO IW416, in a corner case FW may return ready before complete full
> initialization.
> Command timeout may occur at driver load after reboot.
Do you have any idea why? Is it specific to this chip and/or firmware?
I'm hesitant to add magic sleeps to everything, just because you have
one buggy chip/firmware.
If it's a known issue with a single chip, it seems like you should add a
flag to struct mwifiex_sdio_device / mwifiex_sdio_sd8978.
Brian
> Workaround by adding 100ms delay at checking FW status.
>
> Signed-off-by: David Lin <yu-hao.lin@nxp.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [EXT] Re: [PATCH] wifi: mwifiex: added extra delay for firmware ready.
2023-12-05 20:00 ` Francesco Dolcini
@ 2023-12-06 1:53 ` David Lin
0 siblings, 0 replies; 5+ messages in thread
From: David Lin @ 2023-12-06 1:53 UTC (permalink / raw)
To: Francesco Dolcini
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
briannorris@chromium.org, kvalo@kernel.org, Pete Hsieh
> From: Francesco Dolcini <francesco@dolcini.it>
> Sent: Wednesday, December 6, 2023 4:01 AM
> To: David Lin <yu-hao.lin@nxp.com>
> Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org;
> briannorris@chromium.org; kvalo@kernel.org; francesco@dolcini.it; Pete
> Hsieh <tsung-hsien.hsieh@nxp.com>
> Subject: [EXT] Re: [PATCH] wifi: mwifiex: added extra delay for firmware ready.
>
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
>
>
> Hello David,
>
> thanks for your patch. Planning to run some test on this over the next days and
> we'll provide some actual feedback if this really solves the issue we are
> affected by.
>
> Just a couple of nitpicky comments on the actual patch.
>
>
> On the commit message you should use imperative mood, e.g.
>
> `wifi: mwifiex: add extra delay for firmware ready`
>
> with no period at the end of the line.
>
Thanks. I will fix it in patch v2.
> On Tue, Nov 28, 2023 at 04:25:44PM +0800, David Lin wrote:
> > For SDIO IW416, in a corner case FW may return ready before complete
> > full initialization.
> > Command timeout may occur at driver load after reboot.
> > Workaround by adding 100ms delay at checking FW status.
> >
> > Signed-off-by: David Lin <yu-hao.lin@nxp.com>
>
> Add
>
> Cc: stable@...
>
Thanks. I will add "cc: stable" in patch v2.
> > ---
> > drivers/net/wireless/marvell/mwifiex/sdio.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c
> > b/drivers/net/wireless/marvell/mwifiex/sdio.c
> > index 6462a0ffe698..744e9403430a 100644
> > --- a/drivers/net/wireless/marvell/mwifiex/sdio.c
> > +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
> > @@ -783,6 +783,9 @@ static int mwifiex_check_fw_status(struct
> mwifiex_adapter *adapter,
> > ret = -1;
> > }
> >
> > + if (!ret)
> > + msleep(100);
> > +
>
> you could just add the delay after
>
> if (firmware_stat == FIRMWARE_READY_SDIO) {
>
> this would be more read-able to me. Adding also a short comment like
>
> /* Firmware might pretend to be ready, when it's not.
> * Wait a little bit more as a workaround */
>
O.K.
>
> Francesco
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [EXT] Re: [PATCH] wifi: mwifiex: added extra delay for firmware ready.
2023-12-05 20:26 ` Brian Norris
@ 2023-12-06 2:19 ` David Lin
0 siblings, 0 replies; 5+ messages in thread
From: David Lin @ 2023-12-06 2:19 UTC (permalink / raw)
To: Brian Norris
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
kvalo@kernel.org, francesco@dolcini.it, Pete Hsieh
> From: Brian Norris <briannorris@chromium.org>
> Sent: Wednesday, December 6, 2023 4:27 AM
> To: David Lin <yu-hao.lin@nxp.com>
> Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org;
> kvalo@kernel.org; francesco@dolcini.it; Pete Hsieh
> <tsung-hsien.hsieh@nxp.com>
> Subject: [EXT] Re: [PATCH] wifi: mwifiex: added extra delay for firmware ready.
>
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report
> this email' button
>
>
> On Tue, Nov 28, 2023 at 04:25:44PM +0800, David Lin wrote:
> > For SDIO IW416, in a corner case FW may return ready before complete
> > full initialization.
> > Command timeout may occur at driver load after reboot.
>
> Do you have any idea why? Is it specific to this chip and/or firmware?
> I'm hesitant to add magic sleeps to everything, just because you have one
> buggy chip/firmware.
>
> If it's a known issue with a single chip, it seems like you should add a flag to
> struct mwifiex_sdio_device / mwifiex_sdio_sd8978.
>
This issue is reported by customer
We confirmed it's specific to this chip and 100ms is sufficient and relatively safe/easy then change FW.
Will add flag to struct mwifiex_sdio_device / mwifiex_sdio_sd8978
> Brian
>
> > Workaround by adding 100ms delay at checking FW status.
> >
> > Signed-off-by: David Lin <yu-hao.lin@nxp.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-12-06 2:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-28 8:25 [PATCH] wifi: mwifiex: added extra delay for firmware ready David Lin
2023-12-05 20:00 ` Francesco Dolcini
2023-12-06 1:53 ` [EXT] " David Lin
2023-12-05 20:26 ` Brian Norris
2023-12-06 2:19 ` [EXT] " David Lin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).