[PATCH wireless] wifi: nxpwifi: fail the firmware download on a poll timeout

From: Karl Mehltretter

Date: Sat Oct 03 2026 - 15:23:11 EST


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@xxxxxxxxx>
---
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