* [PATCH ath-next] wifi: ath10k: avoid unnecessary wait for service ready message
@ 2025-08-11 9:26 Baochen Qiang
2025-09-18 7:27 ` Vasanthakumar Thiagarajan
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Baochen Qiang @ 2025-08-11 9:26 UTC (permalink / raw)
To: Jeff Johnson, Kalle Valo, Baochen Qiang
Cc: Jeff Johnson, linux-wireless, ath10k, linux-kernel, Paul Menzel,
Baochen Qiang
Commit e57b7d62a1b2 ("wifi: ath10k: poll service ready message before
failing") works around the failure in waiting for the service ready
message by active polling. Note the polling is triggered after initial
wait timeout, which means that the wait-till-timeout can not be avoided
even the message is ready.
A possible fix is to do polling once before wait as well, however this
can not handle the race that the message arrives right after polling.
So the solution is to do periodic polling until timeout.
Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00309-QCARMSWPZ-1
Fixes: e57b7d62a1b2 ("wifi: ath10k: poll service ready message before failing")
Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
Closes: https://lore.kernel.org/all/97a15967-5518-4731-a8ff-d43ff7f437b0@molgen.mpg.de
Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/wmi.c | 39 +++++++++++++++++------------------
1 file changed, 19 insertions(+), 20 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index cb8ae751eb312109f74985580065c3b9d3806d51..e595b0979a56d3110ce0acf534e718a4a1f36a0b 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1764,33 +1764,32 @@ void ath10k_wmi_put_wmi_channel(struct ath10k *ar, struct wmi_channel *ch,
int ath10k_wmi_wait_for_service_ready(struct ath10k *ar)
{
+ unsigned long timeout = jiffies + WMI_SERVICE_READY_TIMEOUT_HZ;
unsigned long time_left, i;
- time_left = wait_for_completion_timeout(&ar->wmi.service_ready,
- WMI_SERVICE_READY_TIMEOUT_HZ);
- if (!time_left) {
- /* Sometimes the PCI HIF doesn't receive interrupt
- * for the service ready message even if the buffer
- * was completed. PCIe sniffer shows that it's
- * because the corresponding CE ring doesn't fires
- * it. Workaround here by polling CE rings once.
- */
- ath10k_warn(ar, "failed to receive service ready completion, polling..\n");
-
+ /* Sometimes the PCI HIF doesn't receive interrupt
+ * for the service ready message even if the buffer
+ * was completed. PCIe sniffer shows that it's
+ * because the corresponding CE ring doesn't fires
+ * it. Workaround here by polling CE rings. Since
+ * the message could arrive at any time, continue
+ * polling until timeout.
+ */
+ do {
for (i = 0; i < CE_COUNT; i++)
ath10k_hif_send_complete_check(ar, i, 1);
+ /* The 100 ms granularity is a tradeoff considering scheduler
+ * overhead and response latency
+ */
time_left = wait_for_completion_timeout(&ar->wmi.service_ready,
- WMI_SERVICE_READY_TIMEOUT_HZ);
- if (!time_left) {
- ath10k_warn(ar, "polling timed out\n");
- return -ETIMEDOUT;
- }
-
- ath10k_warn(ar, "service ready completion received, continuing normally\n");
- }
+ msecs_to_jiffies(100));
+ if (time_left)
+ return 0;
+ } while (time_before(jiffies, timeout));
- return 0;
+ ath10k_warn(ar, "failed to receive service ready completion\n");
+ return -ETIMEDOUT;
}
int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar)
---
base-commit: 0f79768f8d665b43b77967d38b5df6ccebe8cb57
change-id: 20250730-ath10k-avoid-unnecessary-wait-a9d48136490f
Best regards,
--
Baochen Qiang <baochen.qiang@oss.qualcomm.com>
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH ath-next] wifi: ath10k: avoid unnecessary wait for service ready message
2025-08-11 9:26 [PATCH ath-next] wifi: ath10k: avoid unnecessary wait for service ready message Baochen Qiang
@ 2025-09-18 7:27 ` Vasanthakumar Thiagarajan
2025-09-18 23:47 ` Jeff Johnson
2025-10-01 6:22 ` [PATCH ath-next] wifi: ath10k: avoid unnecessary wait for service ready message Paul Menzel
2 siblings, 0 replies; 9+ messages in thread
From: Vasanthakumar Thiagarajan @ 2025-09-18 7:27 UTC (permalink / raw)
To: Baochen Qiang, Jeff Johnson, Kalle Valo, Baochen Qiang
Cc: Jeff Johnson, linux-wireless, ath10k, linux-kernel, Paul Menzel
On 8/11/2025 2:56 PM, Baochen Qiang wrote:
> Commit e57b7d62a1b2 ("wifi: ath10k: poll service ready message before
> failing") works around the failure in waiting for the service ready
> message by active polling. Note the polling is triggered after initial
> wait timeout, which means that the wait-till-timeout can not be avoided
> even the message is ready.
>
> A possible fix is to do polling once before wait as well, however this
> can not handle the race that the message arrives right after polling.
> So the solution is to do periodic polling until timeout.
>
> Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00309-QCARMSWPZ-1
>
> Fixes: e57b7d62a1b2 ("wifi: ath10k: poll service ready message before failing")
> Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
> Closes: https://lore.kernel.org/all/97a15967-5518-4731-a8ff-d43ff7f437b0@molgen.mpg.de
> Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH ath-next] wifi: ath10k: avoid unnecessary wait for service ready message
2025-08-11 9:26 [PATCH ath-next] wifi: ath10k: avoid unnecessary wait for service ready message Baochen Qiang
2025-09-18 7:27 ` Vasanthakumar Thiagarajan
@ 2025-09-18 23:47 ` Jeff Johnson
2025-10-17 15:37 ` [REGRESSION] ath10k fails initialization, bisected to "wifi: ath10k: avoid unnecessary wait for service ready message" Klaus Kudielka
2025-10-01 6:22 ` [PATCH ath-next] wifi: ath10k: avoid unnecessary wait for service ready message Paul Menzel
2 siblings, 1 reply; 9+ messages in thread
From: Jeff Johnson @ 2025-09-18 23:47 UTC (permalink / raw)
To: Jeff Johnson, Kalle Valo, Baochen Qiang, Baochen Qiang
Cc: linux-wireless, ath10k, linux-kernel, Paul Menzel
On Mon, 11 Aug 2025 17:26:45 +0800, Baochen Qiang wrote:
> Commit e57b7d62a1b2 ("wifi: ath10k: poll service ready message before
> failing") works around the failure in waiting for the service ready
> message by active polling. Note the polling is triggered after initial
> wait timeout, which means that the wait-till-timeout can not be avoided
> even the message is ready.
>
> A possible fix is to do polling once before wait as well, however this
> can not handle the race that the message arrives right after polling.
> So the solution is to do periodic polling until timeout.
>
> [...]
Applied, thanks!
[1/1] wifi: ath10k: avoid unnecessary wait for service ready message
commit: 51a73f1b2e56b0324b4a3bb8cebc4221b5be4c7a
Best regards,
--
Jeff Johnson <jeff.johnson@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 9+ messages in thread* [REGRESSION] ath10k fails initialization, bisected to "wifi: ath10k: avoid unnecessary wait for service ready message"
2025-09-18 23:47 ` Jeff Johnson
@ 2025-10-17 15:37 ` Klaus Kudielka
2025-10-17 15:57 ` Jeff Johnson
0 siblings, 1 reply; 9+ messages in thread
From: Klaus Kudielka @ 2025-10-17 15:37 UTC (permalink / raw)
To: Jeff Johnson, Jeff Johnson, Kalle Valo, Baochen Qiang,
Baochen Qiang
Cc: linux-wireless, ath10k, linux-kernel, Paul Menzel, regressions
On Thu, 2025-09-18 at 16:47 -0700, Jeff Johnson wrote:
>
> On Mon, 11 Aug 2025 17:26:45 +0800, Baochen Qiang wrote:
> > Commit e57b7d62a1b2 ("wifi: ath10k: poll service ready message before
> > failing") works around the failure in waiting for the service ready
> > message by active polling. Note the polling is triggered after initial
> > wait timeout, which means that the wait-till-timeout can not be avoided
> > even the message is ready.
> >
> > A possible fix is to do polling once before wait as well, however this
> > can not handle the race that the message arrives right after polling.
> > So the solution is to do periodic polling until timeout.
> >
> > [...]
>
> Applied, thanks!
>
> [1/1] wifi: ath10k: avoid unnecessary wait for service ready message
> commit: 51a73f1b2e56b0324b4a3bb8cebc4221b5be4c7a
>
> Best regards,
Unfortunately, this particular commit completely breaks the ath10k driver in my setup.
Hardware:
- Turris Omnia (arch/arm/boot/dts/marvell/armada-385-turris-omnia.dts)
- Wifi card (output from lspci): Network controller: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter
dmesg output after loading ath10k_pci
[ 5.895939] ath10k_pci 0000:02:00.0: pci irq msi oper_irq_mode 2 irq_mode 0 reset_mode 0
[ 6.152971] ath10k_pci 0000:02:00.0: qca988x hw2.0 target 0x4100016c chip_id 0x043202ff sub 0000:0000
[ 6.152994] ath10k_pci 0000:02:00.0: kconfig debug 0 debugfs 0 tracing 0 dfs 1 testmode 0
[ 6.154343] ath10k_pci 0000:02:00.0: firmware ver 10.2.4-1.0-00047 api 5 features no-p2p,raw-mode,mfp,allows-mesh-bcast crc32 35bd9258
[ 6.214165] ath10k_pci 0000:02:00.0: board_file api 1 bmi_id N/A crc32 bebc7c08
So far so good, but then come the problematic error messages:
[ 12.509390] ath10k_pci 0000:02:00.0: wmi unified ready event not received
[ 12.580885] ath10k_pci 0000:02:00.0: could not init core (-110)
[ 12.586891] ath10k_pci 0000:02:00.0: could not probe fw (-110)
And the corresponding netdevice does not appear at all.
---
If I revert said commit (on top of current mainline), all is good again:
[ 6.112174] ath10k_pci 0000:02:00.0: pci irq msi oper_irq_mode 2 irq_mode 0 reset_mode 0
[ 6.264184] ath10k_pci 0000:02:00.0: qca988x hw2.0 target 0x4100016c chip_id 0x043202ff sub 0000:0000
[ 6.264199] ath10k_pci 0000:02:00.0: kconfig debug 0 debugfs 0 tracing 0 dfs 1 testmode 0
[ 6.265591] ath10k_pci 0000:02:00.0: firmware ver 10.2.4-1.0-00047 api 5 features no-p2p,raw-mode,mfp,allows-mesh-bcast crc32 35bd9258
[ 6.298955] ath10k_pci 0000:02:00.0: board_file api 1 bmi_id N/A crc32 bebc7c08
[ 7.458285] ath10k_pci 0000:02:00.0: htt-ver 2.1 wmi-op 5 htt-op 2 cal otp max-sta 128 raw 0 hwcrypto 1
[ 8.910074] ath10k_pci 0000:02:00.0: pdev param 0 not supported by firmware
[ 8.934074] ath10k_pci 0000:02:00.0 wlan1: entered allmulticast mode
[ 8.934187] ath10k_pci 0000:02:00.0 wlan1: entered promiscuous mode
Best regards, Klaus
#regzbot introduced: 51a73f1b2e56b0324b4a3bb8cebc4221b5be4c7a ("wifi: ath10k: avoid unnecessary wait for service ready message")
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [REGRESSION] ath10k fails initialization, bisected to "wifi: ath10k: avoid unnecessary wait for service ready message"
2025-10-17 15:37 ` [REGRESSION] ath10k fails initialization, bisected to "wifi: ath10k: avoid unnecessary wait for service ready message" Klaus Kudielka
@ 2025-10-17 15:57 ` Jeff Johnson
2025-10-18 13:50 ` Klaus Kudielka
0 siblings, 1 reply; 9+ messages in thread
From: Jeff Johnson @ 2025-10-17 15:57 UTC (permalink / raw)
To: Klaus Kudielka, Jeff Johnson, Kalle Valo, Baochen Qiang,
Baochen Qiang
Cc: linux-wireless, ath10k, linux-kernel, Paul Menzel, regressions
On 10/17/2025 8:37 AM, Klaus Kudielka wrote:
> On Thu, 2025-09-18 at 16:47 -0700, Jeff Johnson wrote:
>>
>> On Mon, 11 Aug 2025 17:26:45 +0800, Baochen Qiang wrote:
>>> Commit e57b7d62a1b2 ("wifi: ath10k: poll service ready message before
>>> failing") works around the failure in waiting for the service ready
>>> message by active polling. Note the polling is triggered after initial
>>> wait timeout, which means that the wait-till-timeout can not be avoided
>>> even the message is ready.
>>>
>>> A possible fix is to do polling once before wait as well, however this
>>> can not handle the race that the message arrives right after polling.
>>> So the solution is to do periodic polling until timeout.
>>>
>>> [...]
>>
>> Applied, thanks!
>>
>> [1/1] wifi: ath10k: avoid unnecessary wait for service ready message
>> commit: 51a73f1b2e56b0324b4a3bb8cebc4221b5be4c7a
>>
>> Best regards,
>
>
> Unfortunately, this particular commit completely breaks the ath10k driver in my setup.
>
>
> Hardware:
> - Turris Omnia (arch/arm/boot/dts/marvell/armada-385-turris-omnia.dts)
> - Wifi card (output from lspci): Network controller: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter
This issue was previously reported with that particular chipset.
This is currently being tracked at:
https://bugzilla.kernel.org/show_bug.cgi?id=220671
It may be useful to supply your information as a separate record to that bug.
/jeff
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [REGRESSION] ath10k fails initialization, bisected to "wifi: ath10k: avoid unnecessary wait for service ready message"
2025-10-17 15:57 ` Jeff Johnson
@ 2025-10-18 13:50 ` Klaus Kudielka
2025-10-22 8:00 ` Baochen Qiang
0 siblings, 1 reply; 9+ messages in thread
From: Klaus Kudielka @ 2025-10-18 13:50 UTC (permalink / raw)
To: Jeff Johnson, Jeff Johnson, Kalle Valo, Baochen Qiang,
Baochen Qiang
Cc: linux-wireless, ath10k, linux-kernel, Paul Menzel, regressions
On Fri, 2025-10-17 at 08:57 -0700, Jeff Johnson wrote:
> On 10/17/2025 8:37 AM, Klaus Kudielka wrote:
> > Unfortunately, this particular commit completely breaks the ath10k driver in my setup.
> >
> >
> > Hardware:
> > - Turris Omnia (arch/arm/boot/dts/marvell/armada-385-turris-omnia.dts)
> > - Wifi card (output from lspci): Network controller: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter
>
> This issue was previously reported with that particular chipset.
> This is currently being tracked at:
> https://bugzilla.kernel.org/show_bug.cgi?id=220671
>
> It may be useful to supply your information as a separate record to that bug.
>
> /jeff
Some more observations on that topic with the hardware shown above.
ath10k_core_start() calls ath10k_wmi_wait_for_service_ready(), and later ath10k_wmi_wait_for_unified_ready().
The now *unconditional* call to ath10k_hif_send_complete_check() inside ath10k_wmi_wait_for_service_ready()
makes the later call to ath10k_wmi_wait_for_unified_ready() fail.
If I call and handle wait_for_completion_timeout() first (as it was before the patch),
ath10k_hif_send_complete_check() is *not* called, and both ath10k_wmi_wait_for_service_ready() and
ath10k_wmi_wait_for_unified_ready() succeed. Everything is back to normal.
Side note:
ath10k_wmi_wait_for_service_ready() succeeds in both cases with time_left == WMI_SERVICE_READY_TIMEOUT_HZ.
#regzbot monitor: https://bugzilla.kernel.org/show_bug.cgi?id=220671
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [REGRESSION] ath10k fails initialization, bisected to "wifi: ath10k: avoid unnecessary wait for service ready message"
2025-10-18 13:50 ` Klaus Kudielka
@ 2025-10-22 8:00 ` Baochen Qiang
2025-10-22 17:30 ` Klaus Kudielka
0 siblings, 1 reply; 9+ messages in thread
From: Baochen Qiang @ 2025-10-22 8:00 UTC (permalink / raw)
To: Klaus Kudielka, Jeff Johnson, Jeff Johnson, Kalle Valo,
Baochen Qiang
Cc: linux-wireless, ath10k, linux-kernel, Paul Menzel, regressions
On 10/18/2025 9:50 PM, Klaus Kudielka wrote:
> On Fri, 2025-10-17 at 08:57 -0700, Jeff Johnson wrote:
>> On 10/17/2025 8:37 AM, Klaus Kudielka wrote:
>>> Unfortunately, this particular commit completely breaks the ath10k driver in my setup.
>>>
>>>
>>> Hardware:
>>> - Turris Omnia (arch/arm/boot/dts/marvell/armada-385-turris-omnia.dts)
>>> - Wifi card (output from lspci): Network controller: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter
>>
>> This issue was previously reported with that particular chipset.
>> This is currently being tracked at:
>> https://bugzilla.kernel.org/show_bug.cgi?id=220671
>>
>> It may be useful to supply your information as a separate record to that bug.
>>
>> /jeff
>
> Some more observations on that topic with the hardware shown above.
>
> ath10k_core_start() calls ath10k_wmi_wait_for_service_ready(), and later ath10k_wmi_wait_for_unified_ready().
>
> The now *unconditional* call to ath10k_hif_send_complete_check() inside ath10k_wmi_wait_for_service_ready()
> makes the later call to ath10k_wmi_wait_for_unified_ready() fail.
>
> If I call and handle wait_for_completion_timeout() first (as it was before the patch),
> ath10k_hif_send_complete_check() is *not* called, and both ath10k_wmi_wait_for_service_ready() and
> ath10k_wmi_wait_for_unified_ready() succeed. Everything is back to normal.
>
> Side note:
> ath10k_wmi_wait_for_service_ready() succeeds in both cases with time_left == WMI_SERVICE_READY_TIMEOUT_HZ.
>
>
> #regzbot monitor: https://bugzilla.kernel.org/show_bug.cgi?id=220671
Thank you Klaus, can you please try if below diff can fix this regression?
diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c
index 7bbda46cfd93..1a981d333b5c 100644
--- a/drivers/net/wireless/ath/ath10k/ce.c
+++ b/drivers/net/wireless/ath/ath10k/ce.c
@@ -1256,6 +1256,19 @@ void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int
ce_id)
}
EXPORT_SYMBOL(ath10k_ce_per_engine_service);
+void ath10k_ce_per_engine_check(struct ath10k *ar, unsigned int ce_id)
+{
+ struct ath10k_ce *ce = ath10k_ce_priv(ar);
+ struct ath10k_ce_pipe *ce_state = &ce->ce_states[ce_id];
+
+ if (ce_state->recv_cb)
+ ce_state->recv_cb(ce_state);
+
+ if (ce_state->send_cb)
+ ce_state->send_cb(ce_state);
+}
+EXPORT_SYMBOL(ath10k_ce_per_engine_check);
+
/*
* Handler for per-engine interrupts on ALL active CEs.
* This is used in cases where the system is sharing a
diff --git a/drivers/net/wireless/ath/ath10k/ce.h b/drivers/net/wireless/ath/ath10k/ce.h
index 27367bd64e95..9923530e51eb 100644
--- a/drivers/net/wireless/ath/ath10k/ce.h
+++ b/drivers/net/wireless/ath/ath10k/ce.h
@@ -255,6 +255,7 @@ int ath10k_ce_cancel_send_next(struct ath10k_ce_pipe *ce_state,
/*==================CE Interrupt Handlers====================*/
void ath10k_ce_per_engine_service_any(struct ath10k *ar);
void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int ce_id);
+void ath10k_ce_per_engine_check(struct ath10k *ar, unsigned int ce_id);
void ath10k_ce_disable_interrupt(struct ath10k *ar, int ce_id);
void ath10k_ce_disable_interrupts(struct ath10k *ar);
void ath10k_ce_enable_interrupt(struct ath10k *ar, int ce_id);
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 97b49bf4ad80..ce8e0c2fb975 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -1812,7 +1812,7 @@ void ath10k_pci_hif_send_complete_check(struct ath10k *ar, u8 pipe,
if (resources > (ar_pci->attr[pipe].src_nentries >> 1))
return;
}
- ath10k_ce_per_engine_service(ar, pipe);
+ ath10k_ce_per_engine_check(ar, pipe);
}
static void ath10k_pci_rx_retry_sync(struct ath10k *ar)
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [REGRESSION] ath10k fails initialization, bisected to "wifi: ath10k: avoid unnecessary wait for service ready message"
2025-10-22 8:00 ` Baochen Qiang
@ 2025-10-22 17:30 ` Klaus Kudielka
0 siblings, 0 replies; 9+ messages in thread
From: Klaus Kudielka @ 2025-10-22 17:30 UTC (permalink / raw)
To: Baochen Qiang, Jeff Johnson, Jeff Johnson, Kalle Valo,
Baochen Qiang
Cc: linux-wireless, ath10k, linux-kernel, Paul Menzel, regressions
On Wed, 2025-10-22 at 16:00 +0800, Baochen Qiang wrote:
> Thank you Klaus, can you please try if below diff can fix this regression?
>
> diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c
> index 7bbda46cfd93..1a981d333b5c 100644
> --- a/drivers/net/wireless/ath/ath10k/ce.c
> +++ b/drivers/net/wireless/ath/ath10k/ce.c
> @@ -1256,6 +1256,19 @@ void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int
> ce_id)
> }
> EXPORT_SYMBOL(ath10k_ce_per_engine_service);
>
> +void ath10k_ce_per_engine_check(struct ath10k *ar, unsigned int ce_id)
> +{
> + struct ath10k_ce *ce = ath10k_ce_priv(ar);
> + struct ath10k_ce_pipe *ce_state = &ce->ce_states[ce_id];
> +
> + if (ce_state->recv_cb)
> + ce_state->recv_cb(ce_state);
> +
> + if (ce_state->send_cb)
> + ce_state->send_cb(ce_state);
> +}
> +EXPORT_SYMBOL(ath10k_ce_per_engine_check);
> +
> /*
> * Handler for per-engine interrupts on ALL active CEs.
> * This is used in cases where the system is sharing a
> diff --git a/drivers/net/wireless/ath/ath10k/ce.h b/drivers/net/wireless/ath/ath10k/ce.h
> index 27367bd64e95..9923530e51eb 100644
> --- a/drivers/net/wireless/ath/ath10k/ce.h
> +++ b/drivers/net/wireless/ath/ath10k/ce.h
> @@ -255,6 +255,7 @@ int ath10k_ce_cancel_send_next(struct ath10k_ce_pipe *ce_state,
> /*==================CE Interrupt Handlers====================*/
> void ath10k_ce_per_engine_service_any(struct ath10k *ar);
> void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int ce_id);
> +void ath10k_ce_per_engine_check(struct ath10k *ar, unsigned int ce_id);
> void ath10k_ce_disable_interrupt(struct ath10k *ar, int ce_id);
> void ath10k_ce_disable_interrupts(struct ath10k *ar);
> void ath10k_ce_enable_interrupt(struct ath10k *ar, int ce_id);
> diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
> index 97b49bf4ad80..ce8e0c2fb975 100644
> --- a/drivers/net/wireless/ath/ath10k/pci.c
> +++ b/drivers/net/wireless/ath/ath10k/pci.c
> @@ -1812,7 +1812,7 @@ void ath10k_pci_hif_send_complete_check(struct ath10k *ar, u8 pipe,
> if (resources > (ar_pci->attr[pipe].src_nentries >> 1))
> return;
> }
> - ath10k_ce_per_engine_service(ar, pipe);
> + ath10k_ce_per_engine_check(ar, pipe);
> }
>
> static void ath10k_pci_rx_retry_sync(struct ath10k *ar)
>
>
Thanks for looking into this.
I applied that patch on top of current mainline, but unfortunately the result is still the same:
[ 6.094149] ath10k_pci 0000:02:00.0: pci irq msi oper_irq_mode 2 irq_mode 0 reset_mode 0
[ 6.241457] ath10k_pci 0000:02:00.0: qca988x hw2.0 target 0x4100016c chip_id 0x043202ff sub 0000:0000
[ 6.241476] ath10k_pci 0000:02:00.0: kconfig debug 0 debugfs 0 tracing 0 dfs 1 testmode 0
[ 6.242901] ath10k_pci 0000:02:00.0: firmware ver 10.2.4-1.0-00047 api 5 features no-p2p,raw-mode,mfp,allows-mesh-bcast crc32 35bd9258
[ 6.309202] ath10k_pci 0000:02:00.0: board_file api 1 bmi_id N/A crc32 bebc7c08
[ 12.509266] ath10k_pci 0000:02:00.0: wmi unified ready event not received
[ 12.581057] ath10k_pci 0000:02:00.0: could not init core (-110)
[ 12.587057] ath10k_pci 0000:02:00.0: could not probe fw (-110)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH ath-next] wifi: ath10k: avoid unnecessary wait for service ready message
2025-08-11 9:26 [PATCH ath-next] wifi: ath10k: avoid unnecessary wait for service ready message Baochen Qiang
2025-09-18 7:27 ` Vasanthakumar Thiagarajan
2025-09-18 23:47 ` Jeff Johnson
@ 2025-10-01 6:22 ` Paul Menzel
2 siblings, 0 replies; 9+ messages in thread
From: Paul Menzel @ 2025-10-01 6:22 UTC (permalink / raw)
To: Baochen Qiang, Jeff Johnson, Kalle Valo, Baochen Qiang
Cc: Jeff Johnson, linux-wireless, ath10k, linux-kernel
Dear Baochen,
Thank you for your patch, and sorry for the late reply.
Am 11.08.25 um 11:26 schrieb Baochen Qiang:
> Commit e57b7d62a1b2 ("wifi: ath10k: poll service ready message before
> failing") works around the failure in waiting for the service ready
> message by active polling. Note the polling is triggered after initial
> wait timeout, which means that the wait-till-timeout can not be avoided
> even the message is ready.
>
> A possible fix is to do polling once before wait as well, however this
> can not handle the race that the message arrives right after polling.
> So the solution is to do periodic polling until timeout.
>
> Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00309-QCARMSWPZ-1
>
> Fixes: e57b7d62a1b2 ("wifi: ath10k: poll service ready message before failing")
> Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
> Closes: https://lore.kernel.org/all/97a15967-5518-4731-a8ff-d43ff7f437b0@molgen.mpg.de
> Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
> ---
> drivers/net/wireless/ath/ath10k/wmi.c | 39 +++++++++++++++++------------------
> 1 file changed, 19 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
> index cb8ae751eb312109f74985580065c3b9d3806d51..e595b0979a56d3110ce0acf534e718a4a1f36a0b 100644
> --- a/drivers/net/wireless/ath/ath10k/wmi.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> @@ -1764,33 +1764,32 @@ void ath10k_wmi_put_wmi_channel(struct ath10k *ar, struct wmi_channel *ch,
>
> int ath10k_wmi_wait_for_service_ready(struct ath10k *ar)
> {
> + unsigned long timeout = jiffies + WMI_SERVICE_READY_TIMEOUT_HZ;
> unsigned long time_left, i;
>
> - time_left = wait_for_completion_timeout(&ar->wmi.service_ready,
> - WMI_SERVICE_READY_TIMEOUT_HZ);
> - if (!time_left) {
> - /* Sometimes the PCI HIF doesn't receive interrupt
> - * for the service ready message even if the buffer
> - * was completed. PCIe sniffer shows that it's
> - * because the corresponding CE ring doesn't fires
> - * it. Workaround here by polling CE rings once.
> - */
> - ath10k_warn(ar, "failed to receive service ready completion, polling..\n");
> -
> + /* Sometimes the PCI HIF doesn't receive interrupt
> + * for the service ready message even if the buffer
> + * was completed. PCIe sniffer shows that it's
> + * because the corresponding CE ring doesn't fires
> + * it. Workaround here by polling CE rings. Since
> + * the message could arrive at any time, continue
> + * polling until timeout.
I would have also re-flowed the comment to make it take up less lines.
> + */
> + do {
> for (i = 0; i < CE_COUNT; i++)
> ath10k_hif_send_complete_check(ar, i, 1);
>
> + /* The 100 ms granularity is a tradeoff considering scheduler
> + * overhead and response latency
> + */
> time_left = wait_for_completion_timeout(&ar->wmi.service_ready,
> - WMI_SERVICE_READY_TIMEOUT_HZ);
> - if (!time_left) {
> - ath10k_warn(ar, "polling timed out\n");
> - return -ETIMEDOUT;
> - }
> -
> - ath10k_warn(ar, "service ready completion received, continuing normally\n");
> - }
> + msecs_to_jiffies(100));
> + if (time_left)
> + return 0;
> + } while (time_before(jiffies, timeout));
>
> - return 0;
> + ath10k_warn(ar, "failed to receive service ready completion\n");
> + return -ETIMEDOUT;
> }
>
> int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar)
Great to have this improved upstream!
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Kind regards,
Paul
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-10-22 17:30 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11 9:26 [PATCH ath-next] wifi: ath10k: avoid unnecessary wait for service ready message Baochen Qiang
2025-09-18 7:27 ` Vasanthakumar Thiagarajan
2025-09-18 23:47 ` Jeff Johnson
2025-10-17 15:37 ` [REGRESSION] ath10k fails initialization, bisected to "wifi: ath10k: avoid unnecessary wait for service ready message" Klaus Kudielka
2025-10-17 15:57 ` Jeff Johnson
2025-10-18 13:50 ` Klaus Kudielka
2025-10-22 8:00 ` Baochen Qiang
2025-10-22 17:30 ` Klaus Kudielka
2025-10-01 6:22 ` [PATCH ath-next] wifi: ath10k: avoid unnecessary wait for service ready message Paul Menzel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).