From 323025844fb58fa8669268bcaa976b6e52ad2c37 Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Fri, 28 Feb 2025 11:07:23 -0500 Subject: [PATCH] ath11k_nss: fix null chanctx warning for NSS dynamic VLAN Patch is updated to match closer to QSDK's implementation for ath11k/12k. The null chanctx warning is likely due to the way NSS is managing the interface. This patch (for now) is a workaround to prevent the BUG_ON() from triggering for dynamic VLANs. Signed-off-by: Sean Khan --- ...chanctx-warning-for-NSS-dynamic-VLAN.patch | 36 +++++++++++++++++++ ...chanctx-warning-for-NSS-dynamic-VLAN.patch | 21 +++++++++++ 2 files changed, 57 insertions(+) create mode 100644 package/kernel/mac80211/patches/nss/ath11k/999-922-ath11k-fix-null-chanctx-warning-for-NSS-dynamic-VLAN.patch create mode 100644 package/kernel/mac80211/patches/nss/subsys/999-922-mac80211-fix-null-chanctx-warning-for-NSS-dynamic-VLAN.patch diff --git a/package/kernel/mac80211/patches/nss/ath11k/999-922-ath11k-fix-null-chanctx-warning-for-NSS-dynamic-VLAN.patch b/package/kernel/mac80211/patches/nss/ath11k/999-922-ath11k-fix-null-chanctx-warning-for-NSS-dynamic-VLAN.patch new file mode 100644 index 0000000000..2c720a473a --- /dev/null +++ b/package/kernel/mac80211/patches/nss/ath11k/999-922-ath11k-fix-null-chanctx-warning-for-NSS-dynamic-VLAN.patch @@ -0,0 +1,36 @@ +--- a/drivers/net/wireless/ath/ath11k/dp_tx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c +@@ -275,6 +275,7 @@ tcl_ring_sel: + + ti.data_len = skb->len - ti.pkt_offset; + skb_cb->pkt_offset = ti.pkt_offset; ++ skb_cb->paddr = ti.paddr; + skb_cb->vif = arvif->vif; + skb_cb->ar = ar; + +@@ -283,11 +284,9 @@ tcl_ring_sel: + atomic_inc(&ab->soc_stats.tx_err.misc_fail); + ath11k_warn(ab, "failed to DMA map data Tx buffer\n"); + ret = -ENOMEM; +- goto fail_remove_idr; ++ goto fail_pull_skb; + } + +- skb_cb->paddr = ti.paddr; +- + if (ring_id == DP_TCL_NUM_RING_MAX) + hal_ring_id = dp->tcl_cmd_ring.ring_id; + else +@@ -343,10 +342,11 @@ tcl_ring_sel: + fail_unmap_dma: + dma_unmap_single(ab->dev, ti.paddr, ti.data_len, DMA_TO_DEVICE); + +-fail_remove_idr: ++fail_pull_skb: + if (ti.pkt_offset) + skb_pull(skb, ti.pkt_offset); + ++fail_remove_idr: + spin_lock_bh(&tx_ring->tx_idr_lock); + tx_ring->idr_pool[idr].id = -1; + clear_bit(idr, tx_ring->idrs); diff --git a/package/kernel/mac80211/patches/nss/subsys/999-922-mac80211-fix-null-chanctx-warning-for-NSS-dynamic-VLAN.patch b/package/kernel/mac80211/patches/nss/subsys/999-922-mac80211-fix-null-chanctx-warning-for-NSS-dynamic-VLAN.patch new file mode 100644 index 0000000000..ecc7cec1ff --- /dev/null +++ b/package/kernel/mac80211/patches/nss/subsys/999-922-mac80211-fix-null-chanctx-warning-for-NSS-dynamic-VLAN.patch @@ -0,0 +1,21 @@ +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -6323,13 +6323,17 @@ void ieee80211_tx_skb_tid(struct ieee802 + { + struct ieee80211_chanctx_conf *chanctx_conf; + enum nl80211_band band; ++ struct ieee80211_local *local = sdata->local; + + rcu_read_lock(); + if (!ieee80211_vif_is_mld(&sdata->vif)) { + WARN_ON(link_id >= 0); + chanctx_conf = + rcu_dereference(sdata->vif.bss_conf.chanctx_conf); +- if (WARN_ON(!chanctx_conf)) { ++ if (!chanctx_conf) { ++ if (!ieee80211_hw_check(&local->hw, SUPPORTS_NSS_OFFLOAD)) { ++ WARN_ON(1); ++ } + rcu_read_unlock(); + kfree_skb(skb); + return;