From: Kang Yang <kang.yang@oss.qualcomm.com>
To: Jeff Johnson <jjohnson@kernel.org>,
Loic Poulain <loic.poulain@oss.qualcomm.com>,
Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Cc: Jeff Johnson <jeff.johnson@oss.qualcomm.com>,
linux-wireless@vger.kernel.org, ath10k@lists.infradead.org,
linux-kernel@vger.kernel.org,
Kang Yang <kang.yang@oss.qualcomm.com>
Subject: [PATCH ath-next v3 07/10] wifi: ath10k: trigger recovery on PCIe MMIO wake-up failures
Date: Thu, 12 Nov 2026 03:26:06 -0800 [thread overview]
Message-ID: <20261112-10k-sdio-crash-v3-7-24f03f300bb2@oss.qualcomm.com> (raw)
In-Reply-To: <20261112-10k-sdio-crash-v3-0-24f03f300bb2@oss.qualcomm.com>
Commit 77258d409ce4 ("ath10k: enable pci soc powersaving")
introduced MMIO wake-up handling through ath10k_pci_wake().
The current code only logs an error when the target cannot be
woken for an MMIO access:
failed to wake target for read32 at 0x00036044: -110
failed to wake target for write32 of 0xfffff81f at 0x00034834: -110
When the target or PCIe link stops responding, an MMIO wake-up
failure may be the earliest indication that the device is no
longer accessible. Since it does not trigger recovery, recovery
may be delayed until another path requests it.
Trigger recovery immediately on MMIO wake-up failures while the
device is running. Also abort PCIe wake, BMI and target-
initialization waits once the device enters ATH10K_STATE_WEDGED,
because no further hardware progress is possible.
This triggers recovery earlier and avoids unnecessary timeout
delays that may lead to suspend watchdog timeouts.
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
Fixes: 77258d409ce4 ("ath10k: enable pci soc powersaving")
Signed-off-by: Kang Yang <kang.yang@oss.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/pci.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 335bc7c488e4..0c671630cfc9 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -478,6 +478,10 @@ static int ath10k_pci_wake_wait(struct ath10k *ar)
return 0;
}
+ /* The device cannot wake once it is wedged. */
+ if (ar->state == ATH10K_STATE_WEDGED)
+ return -ESHUTDOWN;
+
udelay(curr_delay);
tot_delay += curr_delay;
@@ -642,6 +646,16 @@ static void ath10k_bus_pci_write32(struct ath10k *ar, u32 offset, u32 value)
if (ret) {
ath10k_warn(ar, "failed to wake target for write32 of 0x%08x at 0x%08x: %d\n",
value, offset, ret);
+ /*
+ * wake_wait timed out; the device is unresponsive at the
+ * MMIO level. write32 returns void so the write is
+ * silently dropped -- kick recovery here instead of
+ * letting an upper WMI wait notice it seconds later.
+ * Guards confine this to runtime; cmpxchg dedups.
+ */
+ if (test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags) &&
+ ar->state == ATH10K_STATE_ON)
+ ath10k_core_start_recovery(ar);
return;
}
@@ -665,6 +679,9 @@ static u32 ath10k_bus_pci_read32(struct ath10k *ar, u32 offset)
if (ret) {
ath10k_warn(ar, "failed to wake target for read32 at 0x%08x: %d\n",
offset, ret);
+ if (test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags) &&
+ ar->state == ATH10K_STATE_ON)
+ ath10k_core_start_recovery(ar);
return 0xffffffff;
}
@@ -2248,6 +2265,12 @@ static int ath10k_pci_bmi_wait(struct ath10k *ar,
goto out;
}
+ /* Stop waiting once the device is wedged. */
+ if (ar->state == ATH10K_STATE_WEDGED) {
+ ret = -ESHUTDOWN;
+ goto out;
+ }
+
schedule();
}
@@ -3308,6 +3331,10 @@ int ath10k_pci_wait_for_target_init(struct ath10k *ar)
if (val & FW_IND_INITIALIZED)
break;
+ /* Stop waiting once the device is wedged. */
+ if (ar->state == ATH10K_STATE_WEDGED)
+ break;
+
if (ar_pci->oper_irq_mode == ATH10K_PCI_IRQ_INTX)
/* Fix potential race by repeating CORE_BASE writes */
ath10k_pci_enable_intx_irq(ar);
--
2.34.1
next prev parent reply other threads:[~2026-11-12 11:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 11:25 [PATCH ath-next v3 00/10] wifi: ath10k: fix recovery and WEDGED failure handling Kang Yang
2026-11-12 11:26 ` [PATCH ath-next v3 01/10] wifi: ath10k: fix SDIO aux workqueue starvation in recovery detection Kang Yang
2026-11-13 9:24 ` Loic Poulain
2026-11-20 6:42 ` Kang Yang
2026-11-12 11:26 ` [PATCH ath-next v3 02/10] wifi: ath10k: wake blocked waiters when entering WEDGED state Kang Yang
2026-11-12 11:26 ` [PATCH ath-next v3 03/10] wifi: ath10k: also wake remaining blocked waiters Kang Yang
2026-11-12 11:26 ` [PATCH ath-next v3 04/10] wifi: ath10k: bound recovery time before entering WEDGED Kang Yang
2026-11-12 11:26 ` [PATCH ath-next v3 05/10] wifi: ath10k: hard-block the radio when entering WEDGED state Kang Yang
2026-11-12 11:26 ` [PATCH ath-next v3 06/10] wifi: ath10k: remove now-unused driver_recovery completion Kang Yang
2026-11-12 11:26 ` Kang Yang [this message]
2026-11-12 11:26 ` [PATCH ath-next v3 08/10] wifi: ath10k: trigger recovery on corrupted HTC bundle lookahead Kang Yang
2026-11-12 11:26 ` [PATCH ath-next v3 09/10] wifi: ath10k: reject scan requests while the device is not running Kang Yang
2026-11-12 11:26 ` [PATCH ath-next v3 10/10] wifi: ath10k: drop async writes and sleep timer across power cycles Kang Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261112-10k-sdio-crash-v3-7-24f03f300bb2@oss.qualcomm.com \
--to=kang.yang@oss.qualcomm.com \
--cc=ath10k@lists.infradead.org \
--cc=baochen.qiang@oss.qualcomm.com \
--cc=jeff.johnson@oss.qualcomm.com \
--cc=jjohnson@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=loic.poulain@oss.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®