diff mbox series

[1/2] wifi: mwifiex: fix SDIO firmware read timeout handling

Message ID 20231020094654.33258-1-dmantipov@yandex.ru (mailing list archive)
State Rejected
Delegated to: Kalle Valo
Headers show
Series [1/2] wifi: mwifiex: fix SDIO firmware read timeout handling | expand

Commit Message

Dmitry Antipov Oct. 20, 2023, 9:46 a.m. UTC
In 'mwifiex_sdio_generic_fw_dump()', move the check whether
'sdio_readb()' has failed for MAX_POLL_TRIES times out of
the reading loop. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
 drivers/net/wireless/marvell/mwifiex/sdio.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Brian Norris Oct. 23, 2023, 4:37 p.m. UTC | #1
On Fri, Oct 20, 2023 at 2:47 AM Dmitry Antipov <dmantipov@yandex.ru> wrote:
>
> In 'mwifiex_sdio_generic_fw_dump()', move the check whether
> 'sdio_readb()' has failed for MAX_POLL_TRIES times out of
> the reading loop. Compile tested only.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> ---
>  drivers/net/wireless/marvell/mwifiex/sdio.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

We've already discussed and rejected this patch, if you aren't
planning on doing any real testing with it.

Subject: Re: [PATCH] wifi: mwifiex: fix SDIO firmware dump wait
https://lore.kernel.org/all/CA+ASDXNu-CWa9V5Oc-01pLp72iMVRw7m46+bDdNUxVmfrR9PSQ@mail.gmail.com/

It's *probably* correct, but it's risky without any cursory testing.
diff mbox series

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index 6462a0ffe698..d80bd3816e3c 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -2889,12 +2889,12 @@  static void mwifiex_sdio_generic_fw_dump(struct mwifiex_adapter *adapter)
 			}
 			if (start_flag == 0)
 				break;
-			if (tries == MAX_POLL_TRIES) {
-				mwifiex_dbg(adapter, ERROR,
-					    "FW not ready to dump\n");
-				ret = -1;
-				goto done;
-			}
+		}
+		if (tries == MAX_POLL_TRIES) {
+			mwifiex_dbg(adapter, ERROR,
+				    "FW not ready to dump\n");
+			ret = -1;
+			goto done;
 		}
 		usleep_range(100, 200);
 	}