Skip to content

Commit d369788

Browse files
committed
Merge tag 'ath-current-20251006' of git://git.kernel.org/pub/scm/linux/kernel/git/ath/ath
Jeff Johnson says: ================== ath.git update for v6.18-rc1 Fix memory leaks in both ath10k and ath12k. Fix a sparse issue in ath11k. Allow ath11k suspend/resume to work on more Lenovo laptops. ================== Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 parents a2a69ad + 9c78e74 commit d369788

4 files changed

Lines changed: 72 additions & 27 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,6 +1937,7 @@ int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id)
19371937
if (cmd_id == WMI_CMD_UNSUPPORTED) {
19381938
ath10k_warn(ar, "wmi command %d is not supported by firmware\n",
19391939
cmd_id);
1940+
dev_kfree_skb_any(skb);
19401941
return ret;
19411942
}
19421943

drivers/net/wireless/ath/ath11k/core.c

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -912,42 +912,84 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
912912
static const struct dmi_system_id ath11k_pm_quirk_table[] = {
913913
{
914914
.driver_data = (void *)ATH11K_PM_WOW,
915-
.matches = {
915+
.matches = { /* X13 G4 AMD #1 */
916+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
917+
DMI_MATCH(DMI_PRODUCT_NAME, "21J3"),
918+
},
919+
},
920+
{
921+
.driver_data = (void *)ATH11K_PM_WOW,
922+
.matches = { /* X13 G4 AMD #2 */
916923
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
917924
DMI_MATCH(DMI_PRODUCT_NAME, "21J4"),
918925
},
919926
},
920927
{
921928
.driver_data = (void *)ATH11K_PM_WOW,
922-
.matches = {
929+
.matches = { /* T14 G4 AMD #1 */
930+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
931+
DMI_MATCH(DMI_PRODUCT_NAME, "21K3"),
932+
},
933+
},
934+
{
935+
.driver_data = (void *)ATH11K_PM_WOW,
936+
.matches = { /* T14 G4 AMD #2 */
923937
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
924938
DMI_MATCH(DMI_PRODUCT_NAME, "21K4"),
925939
},
926940
},
927941
{
928942
.driver_data = (void *)ATH11K_PM_WOW,
929-
.matches = {
943+
.matches = { /* P14s G4 AMD #1 */
944+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
945+
DMI_MATCH(DMI_PRODUCT_NAME, "21K5"),
946+
},
947+
},
948+
{
949+
.driver_data = (void *)ATH11K_PM_WOW,
950+
.matches = { /* P14s G4 AMD #2 */
930951
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
931952
DMI_MATCH(DMI_PRODUCT_NAME, "21K6"),
932953
},
933954
},
934955
{
935956
.driver_data = (void *)ATH11K_PM_WOW,
936-
.matches = {
957+
.matches = { /* T16 G2 AMD #1 */
958+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
959+
DMI_MATCH(DMI_PRODUCT_NAME, "21K7"),
960+
},
961+
},
962+
{
963+
.driver_data = (void *)ATH11K_PM_WOW,
964+
.matches = { /* T16 G2 AMD #2 */
937965
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
938966
DMI_MATCH(DMI_PRODUCT_NAME, "21K8"),
939967
},
940968
},
941969
{
942970
.driver_data = (void *)ATH11K_PM_WOW,
943-
.matches = {
971+
.matches = { /* P16s G2 AMD #1 */
972+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
973+
DMI_MATCH(DMI_PRODUCT_NAME, "21K9"),
974+
},
975+
},
976+
{
977+
.driver_data = (void *)ATH11K_PM_WOW,
978+
.matches = { /* P16s G2 AMD #2 */
944979
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
945980
DMI_MATCH(DMI_PRODUCT_NAME, "21KA"),
946981
},
947982
},
948983
{
949984
.driver_data = (void *)ATH11K_PM_WOW,
950-
.matches = {
985+
.matches = { /* T14s G4 AMD #1 */
986+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
987+
DMI_MATCH(DMI_PRODUCT_NAME, "21F8"),
988+
},
989+
},
990+
{
991+
.driver_data = (void *)ATH11K_PM_WOW,
992+
.matches = { /* T14s G4 AMD #2 */
951993
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
952994
DMI_MATCH(DMI_PRODUCT_NAME, "21F9"),
953995
},

drivers/net/wireless/ath/ath11k/mac.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: BSD-3-Clause-Clear
22
/*
33
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
4-
* Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
4+
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
55
*/
66

77
#include <net/mac80211.h>
@@ -4417,9 +4417,9 @@ static int ath11k_mac_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
44174417
}
44184418

44194419
if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE)
4420-
flags |= WMI_KEY_PAIRWISE;
4420+
flags = WMI_KEY_PAIRWISE;
44214421
else
4422-
flags |= WMI_KEY_GROUP;
4422+
flags = WMI_KEY_GROUP;
44234423

44244424
ath11k_dbg(ar->ab, ATH11K_DBG_MAC,
44254425
"%s for peer %pM on vdev %d flags 0x%X, type = %d, num_sta %d\n",
@@ -4456,7 +4456,7 @@ static int ath11k_mac_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
44564456

44574457
is_ap_with_no_sta = (vif->type == NL80211_IFTYPE_AP &&
44584458
!arvif->num_stations);
4459-
if ((flags & WMI_KEY_PAIRWISE) || cmd == SET_KEY || is_ap_with_no_sta) {
4459+
if (flags == WMI_KEY_PAIRWISE || cmd == SET_KEY || is_ap_with_no_sta) {
44604460
ret = ath11k_install_key(arvif, key, cmd, peer_addr, flags);
44614461
if (ret) {
44624462
ath11k_warn(ab, "ath11k_install_key failed (%d)\n", ret);
@@ -4470,7 +4470,7 @@ static int ath11k_mac_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
44704470
goto exit;
44714471
}
44724472

4473-
if ((flags & WMI_KEY_GROUP) && cmd == SET_KEY && is_ap_with_no_sta)
4473+
if (flags == WMI_KEY_GROUP && cmd == SET_KEY && is_ap_with_no_sta)
44744474
arvif->reinstall_group_keys = true;
44754475
}
44764476

drivers/net/wireless/ath/ath12k/mac.c

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8290,23 +8290,32 @@ static void ath12k_mgmt_over_wmi_tx_drop(struct ath12k *ar, struct sk_buff *skb)
82908290
wake_up(&ar->txmgmt_empty_waitq);
82918291
}
82928292

8293-
int ath12k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx)
8293+
static void ath12k_mac_tx_mgmt_free(struct ath12k *ar, int buf_id)
82948294
{
8295-
struct sk_buff *msdu = skb;
8295+
struct sk_buff *msdu;
82968296
struct ieee80211_tx_info *info;
8297-
struct ath12k *ar = ctx;
8298-
struct ath12k_base *ab = ar->ab;
82998297

83008298
spin_lock_bh(&ar->txmgmt_idr_lock);
8301-
idr_remove(&ar->txmgmt_idr, buf_id);
8299+
msdu = idr_remove(&ar->txmgmt_idr, buf_id);
83028300
spin_unlock_bh(&ar->txmgmt_idr_lock);
8303-
dma_unmap_single(ab->dev, ATH12K_SKB_CB(msdu)->paddr, msdu->len,
8301+
8302+
if (!msdu)
8303+
return;
8304+
8305+
dma_unmap_single(ar->ab->dev, ATH12K_SKB_CB(msdu)->paddr, msdu->len,
83048306
DMA_TO_DEVICE);
83058307

83068308
info = IEEE80211_SKB_CB(msdu);
83078309
memset(&info->status, 0, sizeof(info->status));
83088310

8309-
ath12k_mgmt_over_wmi_tx_drop(ar, skb);
8311+
ath12k_mgmt_over_wmi_tx_drop(ar, msdu);
8312+
}
8313+
8314+
int ath12k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx)
8315+
{
8316+
struct ath12k *ar = ctx;
8317+
8318+
ath12k_mac_tx_mgmt_free(ar, buf_id);
83108319

83118320
return 0;
83128321
}
@@ -8315,17 +8324,10 @@ static int ath12k_mac_vif_txmgmt_idr_remove(int buf_id, void *skb, void *ctx)
83158324
{
83168325
struct ieee80211_vif *vif = ctx;
83178326
struct ath12k_skb_cb *skb_cb = ATH12K_SKB_CB(skb);
8318-
struct sk_buff *msdu = skb;
83198327
struct ath12k *ar = skb_cb->ar;
8320-
struct ath12k_base *ab = ar->ab;
83218328

8322-
if (skb_cb->vif == vif) {
8323-
spin_lock_bh(&ar->txmgmt_idr_lock);
8324-
idr_remove(&ar->txmgmt_idr, buf_id);
8325-
spin_unlock_bh(&ar->txmgmt_idr_lock);
8326-
dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len,
8327-
DMA_TO_DEVICE);
8328-
}
8329+
if (skb_cb->vif == vif)
8330+
ath12k_mac_tx_mgmt_free(ar, buf_id);
83298331

83308332
return 0;
83318333
}

0 commit comments

Comments
 (0)