All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH wireless] wifi: nxpwifi: fail the firmware download on a poll timeout
@ 2026-10-03 19:22 Karl Mehltretter
  2026-10-03 19:27 ` Johannes Berg
  2026-10-12  2:03 ` jeff.chen_1
  0 siblings, 2 replies; 5+ messages in thread
From: Karl Mehltretter @ 2026-10-03 19:22 UTC (permalink / raw)
  To: Jeff Chen, Francesco Dolcini
  Cc: Karl Mehltretter, Johannes Berg, linux-wireless, linux-kernel

nxpwifi_sdio_poll_card_status() returns the result of the last register
read when the requested status bits never show up. That read succeeded,
so a timeout is reported as success.

nxpwifi_prog_fw_w_helper() therefore skips its "poll status timeout"
branch on a timeout. With an emulated SDIO card that never gets ready,
the driver logs "FW download complete (0 bytes)" and gives up 30 seconds
later with "FW failed to be active in time".

Return -ETIMEDOUT when the poll runs out of tries. mwifiex, which this
function was derived from, returns an error in the same place.

Noticed while looking at a clang -Wconditional-uninitialized warning on
this return statement. Tested only in QEMU with an SDIO card model
written for this test, not on real hardware.

Fixes: 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
 drivers/net/wireless/nxp/nxpwifi/sdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/nxp/nxpwifi/sdio.c b/drivers/net/wireless/nxp/nxpwifi/sdio.c
index 8ef0f6eb49e2..a0d7196c13a2 100644
--- a/drivers/net/wireless/nxp/nxpwifi/sdio.c
+++ b/drivers/net/wireless/nxp/nxpwifi/sdio.c
@@ -665,7 +665,7 @@ nxpwifi_sdio_poll_card_status(struct nxpwifi_adapter *adapter, u8 bits)
 
 	nxpwifi_dbg(adapter, ERROR, "poll card status failed, tries = %d\n", tries);
 
-	return ret;
+	return ret ?: -ETIMEDOUT;
 }
 
 /* Disable SDIO host interrupt and release IRQ. */

base-commit: e767a4ea70a3992c37ed604157d32f0dfbf9b1e3
-- 
2.53.0


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

* Re: [PATCH wireless] wifi: nxpwifi: fail the firmware download on a poll timeout
  2026-10-03 19:22 [PATCH wireless] wifi: nxpwifi: fail the firmware download on a poll timeout Karl Mehltretter
@ 2026-10-03 19:27 ` Johannes Berg
  2026-10-12  2:03 ` jeff.chen_1
  1 sibling, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2026-10-03 19:27 UTC (permalink / raw)
  To: Karl Mehltretter, Jeff Chen, Francesco Dolcini
  Cc: linux-wireless, linux-kernel

On Sat, 2026-10-03 at 21:22 +0200, Karl Mehltretter wrote:
> nxpwifi_sdio_poll_card_status() returns the result of the last register
> read when the requested status bits never show up. That read succeeded,
> so a timeout is reported as success.
> 
> nxpwifi_prog_fw_w_helper() therefore skips its "poll status timeout"
> branch on a timeout. With an emulated SDIO card that never gets ready,
> the driver logs "FW download complete (0 bytes)" and gives up 30 seconds
> later with "FW failed to be active in time".
> 
> Return -ETIMEDOUT when the poll runs out of tries. mwifiex, which this
> function was derived from, returns an error in the same place.
> 
> Noticed while looking at a clang -Wconditional-uninitialized warning on
> this return statement. Tested only in QEMU with an SDIO card model
> written for this test, not on real hardware.
> 
> Fixes: 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x")
> Assisted-by: LLM
> 

Don't let LLMs write commit messages, they suck at it.

johannes

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

* Re: [PATCH wireless] wifi: nxpwifi: fail the firmware download on a poll timeout
  2026-10-03 19:22 [PATCH wireless] wifi: nxpwifi: fail the firmware download on a poll timeout Karl Mehltretter
  2026-10-03 19:27 ` Johannes Berg
@ 2026-10-12  2:03 ` jeff.chen_1
  2026-10-14  6:09   ` jeff.chen_1
  1 sibling, 1 reply; 5+ messages in thread
From: jeff.chen_1 @ 2026-10-12  2:03 UTC (permalink / raw)
  To: Karl Mehltretter
  Cc: Jeff Chen, Jeff Chen, Francesco Dolcini, Johannes Berg,
	linux-wireless

From: Jeff Chen <jeff.chen_1@oss.nxp.com>

On Sat, Oct 03, 2026 at 09:22:56 PM +0200, Karl Mehltretter wrote:
> nxpwifi_sdio_poll_card_status() returns the result of the last register
> read when the requested status bits never show up. That read succeeded,
> so a timeout is reported as success.
> 
> nxpwifi_prog_fw_w_helper() therefore skips its "poll status timeout"
> branch on a timeout. With an emulated SDIO card that never gets ready,
> the driver logs "FW download complete (0 bytes)" and gives up 30 seconds
> later with "FW failed to be active in time".
> 
> Return -ETIMEDOUT when the poll runs out of tries. mwifiex, which this
> function was derived from, returns an error in the same place.
> 
> Noticed while looking at a clang -Wconditional-uninitialized warning on
> this return statement. Tested only in QEMU with an SDIO card model
> written for this test, not on real hardware.

The patch looks good to me.

Could you shorten the commit message a bit? Please focus on the root cause
and the fix. The details about how it was found and tested are probably not
needed.

thanks,
Jeff

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

* Re: [PATCH wireless] wifi: nxpwifi: fail the firmware download on a poll timeout
  2026-10-12  2:03 ` jeff.chen_1
@ 2026-10-14  6:09   ` jeff.chen_1
  2026-10-14  6:32     ` Karl Mehltretter
  0 siblings, 1 reply; 5+ messages in thread
From: jeff.chen_1 @ 2026-10-14  6:09 UTC (permalink / raw)
  To: Karl Mehltretter
  Cc: Jeff Chen, Jeff Chen, Francesco Dolcini, Johannes Berg,
	linux-wireless

From: Jeff Chen <jeff.chen_1@oss.nxp.com>

On Mon, Oct 12, 2026 at 10:03:11 AM +0800, jeff.chen_1@oss.nxp.com wrote:
> From: Jeff Chen <jeff.chen_1@oss.nxp.com>
> 
> On Sat, Oct 03, 2026 at 09:22:56 PM +0200, Karl Mehltretter wrote:
> > nxpwifi_sdio_poll_card_status() returns the result of the last register
> 
> The patch looks good to me.
> 
> Could you shorten the commit message a bit? Please focus on the root cause
> and the fix. The details about how it was found and tested are probably not
> needed.
> 

Since we're approaching the next merge window, I'll apply the patch
with a shortened commit message.

thanks,
Jeff


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

* Re: [PATCH wireless] wifi: nxpwifi: fail the firmware download on a poll timeout
  2026-10-14  6:09   ` jeff.chen_1
@ 2026-10-14  6:32     ` Karl Mehltretter
  0 siblings, 0 replies; 5+ messages in thread
From: Karl Mehltretter @ 2026-10-14  6:32 UTC (permalink / raw)
  To: jeff.chen_1; +Cc: Jeff Chen, Francesco Dolcini, Johannes Berg, linux-wireless

On Wed, Oct 14, 2026 at 02:09:43PM +0100, jeff.chen_1@oss.nxp.com wrote:
> From: Jeff Chen <jeff.chen_1@oss.nxp.com>
> 
> On Mon, Oct 12, 2026 at 10:03:11 AM +0800, jeff.chen_1@oss.nxp.com wrote:
> > From: Jeff Chen <jeff.chen_1@oss.nxp.com>
> > 
> > On Sat, Oct 03, 2026 at 09:22:56 PM +0200, Karl Mehltretter wrote:
> > > nxpwifi_sdio_poll_card_status() returns the result of the last register
> > 
> > The patch looks good to me.
> > 
> > Could you shorten the commit message a bit? Please focus on the root cause
> > and the fix. The details about how it was found and tested are probably not
> > needed.
> > 
> 
> Since we're approaching the next merge window, I'll apply the patch
> with a shortened commit message.
> 

Yes, thank you. I hadn’t had a chance to shorten it yet.

Karl

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

end of thread, other threads:[~2026-10-14  6:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-03 19:22 [PATCH wireless] wifi: nxpwifi: fail the firmware download on a poll timeout Karl Mehltretter
2026-10-03 19:27 ` Johannes Berg
2026-10-12  2:03 ` jeff.chen_1
2026-10-14  6:09   ` jeff.chen_1
2026-10-14  6:32     ` Karl Mehltretter

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.