From 3f3094e87c295e52e9000381da1c3758f8d52b9e Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 16 Sep 2023 16:25:36 +0800 Subject: [PATCH] mac80211: ath11k: add workaround for memory leak issue Signed-off-by: Tianling Shen --- .../patches/ath10k/983-ath10k-allow-vht-on-2g.patch | 2 +- .../984-ath11k-workaround-for-memory-leak.patch | 13 +++++++++++++ .../subsys/600-mac80211-allow-vht-on-2g.patch | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 package/kernel/mac80211/patches/ath11k/984-ath11k-workaround-for-memory-leak.patch diff --git a/package/kernel/mac80211/patches/ath10k/983-ath10k-allow-vht-on-2g.patch b/package/kernel/mac80211/patches/ath10k/983-ath10k-allow-vht-on-2g.patch index 3fb26bff90..33b3d2ef2c 100644 --- a/package/kernel/mac80211/patches/ath10k/983-ath10k-allow-vht-on-2g.patch +++ b/package/kernel/mac80211/patches/ath10k/983-ath10k-allow-vht-on-2g.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -5034,6 +5034,7 @@ static void ath10k_mac_setup_ht_vht_cap( +@@ -5036,6 +5036,7 @@ static void ath10k_mac_setup_ht_vht_cap( if (ar->phy_capability & WHAL_WLAN_11G_CAPABILITY) { band = &ar->mac.sbands[NL80211_BAND_2GHZ]; band->ht_cap = ht_cap; diff --git a/package/kernel/mac80211/patches/ath11k/984-ath11k-workaround-for-memory-leak.patch b/package/kernel/mac80211/patches/ath11k/984-ath11k-workaround-for-memory-leak.patch new file mode 100644 index 0000000000..09a55b0758 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/984-ath11k-workaround-for-memory-leak.patch @@ -0,0 +1,13 @@ +--- a/drivers/net/wireless/ath/ath11k/dp_rx.c ++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c +@@ -370,8 +370,8 @@ int ath11k_dp_rxbufs_replenish(struct at + num_remain = req_entries; + + while (num_remain > 0) { +- skb = dev_alloc_skb(DP_RX_BUFFER_SIZE + +- DP_RX_BUFFER_ALIGN_SIZE); ++ skb = alloc_skb(DP_RX_BUFFER_SIZE + ++ DP_RX_BUFFER_ALIGN_SIZE, GFP_ATOMIC); + if (!skb) + break; + diff --git a/package/kernel/mac80211/patches/subsys/600-mac80211-allow-vht-on-2g.patch b/package/kernel/mac80211/patches/subsys/600-mac80211-allow-vht-on-2g.patch index 5d8742ba95..d0887c4a67 100644 --- a/package/kernel/mac80211/patches/subsys/600-mac80211-allow-vht-on-2g.patch +++ b/package/kernel/mac80211/patches/subsys/600-mac80211-allow-vht-on-2g.patch @@ -12,7 +12,7 @@ have_80mhz = true; --- a/net/mac80211/util.c +++ b/net/mac80211/util.c -@@ -1955,7 +1955,8 @@ static int ieee80211_build_preq_ies_band +@@ -2079,7 +2079,8 @@ static int ieee80211_build_preq_ies_band /* Check if any channel in this sband supports at least 80 MHz */ for (i = 0; i < sband->n_channels; i++) { if (sband->channels[i].flags & (IEEE80211_CHAN_DISABLED | @@ -24,7 +24,7 @@ have_80mhz = true; --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c -@@ -4744,7 +4744,8 @@ static int ieee80211_prep_channel(struct +@@ -4969,7 +4969,8 @@ static int ieee80211_prep_channel(struct have_80mhz = false; for (i = 0; i < sband->n_channels; i++) { if (sband->channels[i].flags & (IEEE80211_CHAN_DISABLED |