Skip to contentSkip to conversation

ath10k: cancel rx worker in hif_stop for SDIO

PATCH In review Wen Gong 2 participants 4 messages Nov 5, 2020 – Nov 7, 2020 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore

Wen Gong

author
#0 lore raw

PATCH 1/1 ath10k: cancel rx worker in hif_stop for SDIO

The rx worker of SDIO should be cancelled after disable interrupt, and release rx sk_buff in queue, otherwise the rx worker maybe still run after hif_stop. And it should be cancelled before napi_synchronize in hif_stop, because the rx worker of SDIO will call napi_schedule, it should have no napi_schedule before napi_synchronize, otherwise it lead napi_synchronize wait untill napi_complete.

Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049

---
 drivers/net/wireless/ath/ath10k/sdio.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/wireless/ath/ath10k/sdio.c +6 -0
index 81ddaafb6721..2c619ef8a87c 100644
@@ -1962,9 +1962,15 @@ static void ath10k_sdio_hif_stop(struct ath10k *ar)
 {
 	struct ath10k_sdio_bus_request *req, *tmp_req;
 	struct ath10k_sdio *ar_sdio = ath10k_sdio_priv(ar);
+	struct sk_buff *skb;
 
 	ath10k_sdio_irq_disable(ar);
 
+	cancel_work_sync(&ar_sdio->async_work_rx);
+
+	while (skb = skb_dequeue(&ar_sdio->rx_head))
+		dev_kfree_skb_any(skb);
+
 	cancel_work_sync(&ar_sdio->wr_async_work);
 
 	spin_lock_bh(&ar_sdio->wr_async_lock);
Signature · 1 line
2.23.0
#1 lore raw
Quoted 20 lines · Wen Gong

The rx worker of SDIO should be cancelled after disable interrupt, and release rx sk_buff in queue, otherwise the rx worker maybe still run after hif_stop. And it should be cancelled before napi_synchronize in hif_stop, because the rx worker of SDIO will call napi_schedule, it should have no napi_schedule before napi_synchronize, otherwise it lead napi_synchronize wait untill napi_complete.

Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049

---
 drivers/net/wireless/ath/ath10k/sdio.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/wireless/ath/ath10k/sdio.c +0 -0
index 81ddaafb6721..2c619ef8a87c 100644
@@ -1962,9 +1962,15 @@ static void ath10k_sdio_hif_stop(struct ath10k *ar)
 {

drivers/net/wireless/ath/ath10k/sdio.c static void ath10k_sdio_hif_stop(struct ath10k *ar) · line 1972

Quoted 10 lines
drivers/net/wireless/ath/ath10k/sdio.c +5 -0
 	struct ath10k_sdio_bus_request *req, *tmp_req;
 	struct ath10k_sdio *ar_sdio = ath10k_sdio_priv(ar);
+	struct sk_buff *skb;
 
 	ath10k_sdio_irq_disable(ar);
 
+	cancel_work_sync(&ar_sdio->async_work_rx);
+
+	while (skb = skb_dequeue(&ar_sdio->rx_head))
+		dev_kfree_skb_any(skb);

This gives a warning:

drivers/net/wireless/ath/ath10k/sdio.c: In function 'ath10k_sdio_hif_stop':
drivers/net/wireless/ath/ath10k/sdio.c:1971:9: warning: suggest parentheses around assignment used as truth value [-Wparentheses]

Fixed in the pending branch.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#2 lore raw
In reply to Wen Gong
Quoted 11 lines · Wen Gong

The rx worker of SDIO should be cancelled after disable interrupt, and release rx sk_buff in queue, otherwise the rx worker maybe still run after hif_stop. And it should be cancelled before napi_synchronize in hif_stop, because the rx worker of SDIO will call napi_schedule, it should have no napi_schedule before napi_synchronize, otherwise it lead napi_synchronize wait untill napi_complete.

Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049

Patch applied to ath-next branch of ath.git, thanks.

9501bc2b16b5 ath10k: cancel rx worker in hif_stop for SDIO

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#3 lore raw
In reply to Wen Gong
Quoted 11 lines · Wen Gong

The rx worker of SDIO should be cancelled after disable interrupt, and release rx sk_buff in queue, otherwise the rx worker maybe still run after hif_stop. And it should be cancelled before napi_synchronize in hif_stop, because the rx worker of SDIO will call napi_schedule, it should have no napi_schedule before napi_synchronize, otherwise it lead napi_synchronize wait untill napi_complete.

Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049

Patch applied to ath-next branch of ath.git, thanks.

9501bc2b16b5 ath10k: cancel rx worker in hif_stop for SDIO

Signature · 9 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k