[PATCH ath-next v5 09/12] wifi: ath10k: trigger recovery on corrupted HTC bundle lookahead
From: Kang Yang
Date: Wed Dec 02 2026 - 01:10:22 EST
When firmware crashes, the SDIO interrupt handler may read a
corrupted RX lookahead whose header reports more messages than
ar->htc.max_msgs_per_htc_bundle. The driver then prints errors such
as:
HTC bundle length 2322 exceeds maximum 32
failed to allocate a bundle: -12
failed to get pending recv messages: -12
failed to process pending SDIO interrupts: -12
The handler returns -ENOMEM without consuming the mailbox lookahead
or checking the firmware-crash CPU interrupt. The SDIO interrupt
therefore remains asserted and ath10k_sdio_irq_handler() repeatedly
processes the same invalid lookahead.
Stress-test logs show that this interrupt storm can continue for
15 to 20 seconds before the firmware watchdog allows the crash
interrupt to be observed and recovery to start. RX remains stalled
and user traffic times out during this interval.
ath10k_sdio_mbox_rx_alloc() already triggers recovery when the
lookahead payload length exceeds ATH10K_HTC_MBOX_MAX_PAYLOAD_LENGTH.
A bundle count above max_msgs_per_htc_bundle is the same class of
corrupted lookahead.
Start recovery as soon as the invalid bundle count is detected so the
HIF is reinitialized instead of waiting for the firmware watchdog.
ath10k_core_start_recovery() does nothing when a recovery is already
pending, which would leave the interrupt storm running, so also mask
the target interrupts.
Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00288-QCARMSWPZ-1
Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00189
Signed-off-by: Kang Yang <kang.yang@xxxxxxxxxxxxxxxx>
---
drivers/net/wireless/ath/ath10k/sdio.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c
index 748ba6749339..bb2bb885b9da 100644
--- a/drivers/net/wireless/ath/ath10k/sdio.c
+++ b/drivers/net/wireless/ath/ath10k/sdio.c
@@ -497,6 +497,8 @@ static int ath10k_sdio_mbox_rx_process_packets(struct ath10k *ar,
return ret;
}
+static int ath10k_sdio_disable_intrs(struct ath10k *ar);
+
static int ath10k_sdio_mbox_alloc_bundle(struct ath10k *ar,
struct ath10k_sdio_rx_data *rx_pkts,
struct ath10k_htc_hdr *htc_hdr,
@@ -513,6 +515,9 @@ static int ath10k_sdio_mbox_alloc_bundle(struct ath10k *ar,
"HTC bundle length %u exceeds maximum %u\n",
le16_to_cpu(htc_hdr->len),
max_msgs);
+ ath10k_core_start_recovery(ar);
+ /* Prevent IRQ storm. */
+ ath10k_sdio_disable_intrs(ar);
return -ENOMEM;
}
--
2.34.1