Skip to contentSkip to conversation

ath10k: Fix offchannel tx failure when no ath10k_mac_tx_frm_has_freq

PATCH In review [email protected] 3 participants 6 messages Oct 18, 2017 – Oct 2, 2019 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath10k: Fix offchannel tx failure when no ath10k_mac_tx_frm_has_freq

From: Ben Greear <[email protected]>

This bug appears to have been added between 4.0 (which works for us), and 4.4, which does not work.

I think this is because the tx-offchannel logic gets in a loop when ath10k_mac_tx_frm_has_freq(ar) is false, so pkt is never actually sent to the firmware for transmit.

This patch fixes the problem on 4.9 for me, and now HS20 clients can work again with my firmware.

---
 drivers/net/wireless/ath/ath10k/mac.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/net/wireless/ath/ath10k/mac.c +11 -11
index c45ca04..f0a7864 100644
@@ -4101,7 +4101,7 @@ static int ath10k_mac_tx(struct ath10k *ar,
 			 struct ieee80211_sta *sta,
 			 enum ath10k_hw_txrx_mode txmode,
 			 enum ath10k_mac_tx_path txpath,
-			 struct sk_buff *skb)
+			 struct sk_buff *skb, bool noque_offchan)
 {
 	struct ieee80211_hw *hw = ar->hw;
 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
@@ -4134,10 +4134,10 @@ static int ath10k_mac_tx(struct ath10k *ar,
 		}
 	}
 
-	if (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) {
+	if ((!noque_offchan) && info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) {
 		if (!ath10k_mac_tx_frm_has_freq(ar)) {
-			ath10k_dbg(ar, ATH10K_DBG_MAC, "queued offchannel skb %pK\n",
-				   skb);
+			ath10k_dbg(ar, ATH10K_DBG_MAC, "no-tx-frm-has-freq: queued offchannel skb %pK, len: %d\n",
+				   skb, skb->len);
 
 			skb_queue_tail(&ar->offchan_tx_queue, skb);
 			ieee80211_queue_work(hw, &ar->offchan_tx_work);
@@ -4198,8 +4198,8 @@ void ath10k_offchan_tx_work(struct work_struct *work)
 
 		mutex_lock(&ar->conf_mutex);
 
-		ath10k_dbg(ar, ATH10K_DBG_MAC, "mac offchannel skb %pK\n",
-			   skb);
+		ath10k_dbg(ar, ATH10K_DBG_MAC, "offchan-tx-work: mac offchannel skb %pK len: %d\n",
+			   skb, skb->len);
 
 		hdr = (struct ieee80211_hdr *)skb->data;
 		peer_addr = ieee80211_get_DA(hdr);
@@ -4245,7 +4245,7 @@ void ath10k_offchan_tx_work(struct work_struct *work)
 		txmode = ath10k_mac_tx_h_get_txmode(ar, vif, sta, skb);
 		txpath = ath10k_mac_tx_h_get_txpath(ar, skb, txmode);
 
-		ret = ath10k_mac_tx(ar, vif, sta, txmode, txpath, skb);
+		ret = ath10k_mac_tx(ar, vif, sta, txmode, txpath, skb, true);
 		if (ret) {
 			ath10k_warn(ar, "failed to transmit offchannel frame: %d\n",
 				    ret);
@@ -4255,8 +4255,8 @@ void ath10k_offchan_tx_work(struct work_struct *work)
 		time_left =
 		wait_for_completion_timeout(&ar->offchan_tx_completed, 3 * HZ);
 		if (time_left == 0)
-			ath10k_warn(ar, "timed out waiting for offchannel skb %pK\n",
-				    skb);
+			ath10k_warn(ar, "timed out waiting for offchannel skb %pK, len: %d\n",
+				    skb, skb->len);
 
 		if (!peer && tmp_peer_created) {
 			ret = ath10k_peer_delete(ar, vdev_id, peer_addr);
@@ -4513,7 +4513,7 @@ int ath10k_mac_tx_push_txq(struct ieee80211_hw *hw,
 		spin_unlock_bh(&ar->htt.tx_lock);
 	}
 
-	ret = ath10k_mac_tx(ar, vif, sta, txmode, txpath, skb);
+	ret = ath10k_mac_tx(ar, vif, sta, txmode, txpath, skb, false);
 	if (unlikely(ret)) {
 		ath10k_warn(ar, "failed to push frame: %d\n", ret);
 
@@ -4802,7 +4802,7 @@ static void ath10k_mac_op_tx(struct ieee80211_hw *hw,
 		spin_unlock_bh(&ar->htt.tx_lock);
 	}
 
-	ret = ath10k_mac_tx(ar, vif, sta, txmode, txpath, skb);
+	ret = ath10k_mac_tx(ar, vif, sta, txmode, txpath, skb, false);
 	if (ret) {
 		ath10k_warn(ar, "failed to transmit frame: %d\n", ret);
 		if (is_htt) {
Signature · 1 line
2.4.11
Tested-by on v1 1/1
#1 lore raw

Hi,

Quoted 5 lines · On 18/10/2017 02:03, [email protected] wrote:

From: Ben Greear <[email protected]>

This bug appears to have been added between 4.0 (which works for us), and 4.4, which does not work.

Quoted 8 lines

I think this is because the tx-offchannel logic gets in a loop when ath10k_mac_tx_frm_has_freq(ar) is false, so pkt is never actually sent to the firmware for transmit.

This patch fixes the problem on 4.9 for me, and now HS20 clients can work again with my firmware.

I have been struggling to send offchannels mgmt frames since a while, as I was always getting:

[18099.253732] ath10k_pci 0000:01:00.0: timed out waiting for offchannel
skb cf0e3780
[18102.293686] ath10k_pci 0000:01:00.0: timed out waiting for offchannel
skb cf0e3780
[18105.333653] ath10k_pci 0000:01:00.0: timed out waiting for offchannel
skb cf0e3780
[18108.373712] ath10k_pci 0000:01:00.0: timed out waiting for offchannel
skb cf0e3780
[18111.413687] ath10k_pci 0000:01:00.0: timed out waiting for offchannel
skb cf0e36c0
[18114.453726] ath10k_pci 0000:01:00.0: timed out waiting for offchannel
skb cf0e3f00
[18117.493773] ath10k_pci 0000:01:00.0: timed out waiting for offchannel
skb cf0e36c0
[18120.533631] ath10k_pci 0000:01:00.0: timed out waiting for offchannel

skb cf0e3f00

After digging through the ath10k patchwork I have found this patch which touches exactly the code I was trying to debug.

After applying this set of changes, I can confirm that sending offchannel frames works again like a charm.

I have tested only one fw though: ver 10.4-3.5.3-00057.

It's a bummer that this trivial but critical patch is not yet merged upstream :-(

Signature · 7 lines
Antonio Quartulli
Kaiwoo.ai

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#2 lore raw
Quoted 40 lines · Antonio Quartulli

Hi,

Quoted 5 lines · On 18/10/2017 02:03, [email protected] wrote:

From: Ben Greear <[email protected]>

This bug appears to have been added between 4.0 (which works for us), and 4.4, which does not work.

Quoted 8 lines

I think this is because the tx-offchannel logic gets in a loop when ath10k_mac_tx_frm_has_freq(ar) is false, so pkt is never actually sent to the firmware for transmit.

This patch fixes the problem on 4.9 for me, and now HS20 clients can work again with my firmware.

I have been struggling to send offchannels mgmt frames since a while, as I was always getting:

[18099.253732] ath10k_pci 0000:01:00.0: timed out waiting for offchannel
skb cf0e3780
[18102.293686] ath10k_pci 0000:01:00.0: timed out waiting for offchannel
skb cf0e3780
[18105.333653] ath10k_pci 0000:01:00.0: timed out waiting for offchannel
skb cf0e3780
[18108.373712] ath10k_pci 0000:01:00.0: timed out waiting for offchannel
skb cf0e3780
[18111.413687] ath10k_pci 0000:01:00.0: timed out waiting for offchannel
skb cf0e36c0
[18114.453726] ath10k_pci 0000:01:00.0: timed out waiting for offchannel
skb cf0e3f00
[18117.493773] ath10k_pci 0000:01:00.0: timed out waiting for offchannel
skb cf0e36c0
[18120.533631] ath10k_pci 0000:01:00.0: timed out waiting for offchannel

skb cf0e3f00

After digging through the ath10k patchwork I have found this patch which touches exactly the code I was trying to debug.

Quoted 7 lines

After applying this set of changes, I can confirm that sending offchannel frames works again like a charm.

I have tested only one fw though: ver 10.4-3.5.3-00057.

It's a bummer that this trivial but critical patch is not yet merged upstream :-(

Ben has it's own firmware and own hacks in kernel so I can't apply them without testing, and it's just very difficult for me to find time to test anything right now.

Quoted 1 line

Thanks! What hardware did you test this? I'll add that to the commit log.

The patch also had some conflicts which I fixed in the pending branch, please check:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=bdc657dd0c0cb7163fcf39b94e664e3d9409140e

Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#3 lore raw

Hi,

Quoted 5 lines · Kalle Valo
Quoted 1 line

Thanks! What hardware did you test this? I'll add that to the commit log.

It was tested on my AP equipped with and QCA4019 and QCA9888.

Quoted 5 lines

The patch also had some conflicts which I fixed in the pending branch, please check:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=bdc657dd0c0cb7163fcf39b94e664e3d9409140e

Looks good to me, thanks!

Regards,

Signature · 7 lines
Antonio Quartulli
Kaiwoo.ai

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

Re: [PATCH] ath10k: Fix offchannel tx failure when noath10k_mac_tx_frm_has_freq

In reply to [email protected]
Quoted 21 lines · [email protected] wrote:

Offchannel management frames were failing:

[18099.253732] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780
[18102.293686] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780
[18105.333653] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780
[18108.373712] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780
[18111.413687] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e36c0
[18114.453726] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3f00
[18117.493773] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e36c0
[18120.533631] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3f00

This bug appears to have been added between 4.0 (which works for us), and 4.4, which does not work.

I think this is because the tx-offchannel logic gets in a loop when ath10k_mac_tx_frm_has_freq(ar) is false, so pkt is never actually sent to the firmware for transmit.

This patch fixes the problem on 4.9 for me, and now HS20 clients can work again with my firmware.

Quoted 6 lines

Antonio: tested with 10.4-3.5.3-00057 on QCA4019 and QCA9888

[[email protected]: improve commit log, remove unneeded parenthesis]

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

cc6df017e557 ath10k: fix offchannel tx failure when no ath10k_mac_tx_frm_has_freq

Signature · 9 lines
https://patchwork.kernel.org/patch/10013117/

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


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

Re: [PATCH] ath10k: Fix offchannel tx failure when noath10k_mac_tx_frm_has_freq

In reply to [email protected]
Quoted 21 lines · [email protected] wrote:

Offchannel management frames were failing:

[18099.253732] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780
[18102.293686] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780
[18105.333653] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780
[18108.373712] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3780
[18111.413687] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e36c0
[18114.453726] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3f00
[18117.493773] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e36c0
[18120.533631] ath10k_pci 0000:01:00.0: timed out waiting for offchannel skb cf0e3f00

This bug appears to have been added between 4.0 (which works for us), and 4.4, which does not work.

I think this is because the tx-offchannel logic gets in a loop when ath10k_mac_tx_frm_has_freq(ar) is false, so pkt is never actually sent to the firmware for transmit.

This patch fixes the problem on 4.9 for me, and now HS20 clients can work again with my firmware.

Quoted 6 lines

Antonio: tested with 10.4-3.5.3-00057 on QCA4019 and QCA9888

[[email protected]: improve commit log, remove unneeded parenthesis]

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

cc6df017e557 ath10k: fix offchannel tx failure when no ath10k_mac_tx_frm_has_freq

Signature · 3 lines
https://patchwork.kernel.org/patch/10013117/

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