Skip to content

Commit 3ef1480

Browse files
Baochen Qianggregkh
authored andcommitted
wifi: ath10k: poll service ready message before failing
[ Upstream commit e57b7d6 ] Currently host relies on CE interrupts to get notified that the service ready message is ready. This results in timeout issue if the interrupt is not fired, due to some unknown reasons. See below logs: [76321.937866] ath10k_pci 0000:02:00.0: wmi service ready event not received ... [76322.016738] ath10k_pci 0000:02:00.0: Could not init core: -110 And finally it causes WLAN interface bring up failure. Change to give it one more chance here by polling CE rings, before failing directly. Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00157-QCARMSWPZ-1 Fixes: 5e3dd15 ("ath10k: mac80211 driver for Qualcomm Atheros 802.11ac CQA98xx devices") Reported-by: James Prestwood <prestwoj@gmail.com> Tested-By: James Prestwood <prestwoj@gmail.com> # on QCA6174 hw3.2 Link: https://lore.kernel.org/linux-wireless/304ce305-fbe6-420e-ac2a-d61ae5e6ca1a@gmail.com/ Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://msgid.link/20240227030409.89702-1-quic_bqiang@quicinc.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ac18de9 commit 3ef1480

File tree

1 file changed

+23
-3
lines changed
  • drivers/net/wireless/ath/ath10k

1 file changed

+23
-3
lines changed

drivers/net/wireless/ath/ath10k/wmi.c

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,12 +1763,32 @@ void ath10k_wmi_put_wmi_channel(struct ath10k *ar, struct wmi_channel *ch,
17631763

17641764
int ath10k_wmi_wait_for_service_ready(struct ath10k *ar)
17651765
{
1766-
unsigned long time_left;
1766+
unsigned long time_left, i;
17671767

17681768
time_left = wait_for_completion_timeout(&ar->wmi.service_ready,
17691769
WMI_SERVICE_READY_TIMEOUT_HZ);
1770-
if (!time_left)
1771-
return -ETIMEDOUT;
1770+
if (!time_left) {
1771+
/* Sometimes the PCI HIF doesn't receive interrupt
1772+
* for the service ready message even if the buffer
1773+
* was completed. PCIe sniffer shows that it's
1774+
* because the corresponding CE ring doesn't fires
1775+
* it. Workaround here by polling CE rings once.
1776+
*/
1777+
ath10k_warn(ar, "failed to receive service ready completion, polling..\n");
1778+
1779+
for (i = 0; i < CE_COUNT; i++)
1780+
ath10k_hif_send_complete_check(ar, i, 1);
1781+
1782+
time_left = wait_for_completion_timeout(&ar->wmi.service_ready,
1783+
WMI_SERVICE_READY_TIMEOUT_HZ);
1784+
if (!time_left) {
1785+
ath10k_warn(ar, "polling timed out\n");
1786+
return -ETIMEDOUT;
1787+
}
1788+
1789+
ath10k_warn(ar, "service ready completion received, continuing normally\n");
1790+
}
1791+
17721792
return 0;
17731793
}
17741794

0 commit comments

Comments
 (0)