Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Apr 2026 21:09:14 +0000
From:      Bjoern A. Zeeb <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 4208012711cc - stable/15 - ath10k: update Atheros/QCA's ath10k driver
Message-ID:  <69e938fa.27cb8.5a9919d2@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=4208012711cc99788233a4562e69b27cc0bd78b1

commit 4208012711cc99788233a4562e69b27cc0bd78b1
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2026-04-19 15:09:30 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-04-22 20:57:14 +0000

    ath10k: update Atheros/QCA's ath10k driver
    
    This version is based on
    git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
    028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ).
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 02b46313fd1461338703a1e02c667b8dbcc36237)
---
 sys/contrib/dev/athk/ath10k/ce.c      | 12 +++-----
 sys/contrib/dev/athk/ath10k/htt_rx.c  |  3 +-
 sys/contrib/dev/athk/ath10k/mac.c     | 10 +++----
 sys/contrib/dev/athk/ath10k/qmi.c     | 10 +++----
 sys/contrib/dev/athk/ath10k/sdio.c    | 10 +++++--
 sys/contrib/dev/athk/ath10k/snoc.c    | 53 +++++++++++++++++++++++++++++++++--
 sys/contrib/dev/athk/ath10k/snoc.h    |  3 ++
 sys/contrib/dev/athk/ath10k/txrx.c    |  2 +-
 sys/contrib/dev/athk/ath10k/usb.c     |  2 +-
 sys/contrib/dev/athk/ath10k/wmi-tlv.c | 10 +++----
 sys/contrib/dev/athk/ath10k/wmi.c     | 32 ++++++++++-----------
 sys/contrib/dev/athk/ath10k/wow.c     |  4 +--
 12 files changed, 100 insertions(+), 51 deletions(-)

diff --git a/sys/contrib/dev/athk/ath10k/ce.c b/sys/contrib/dev/athk/ath10k/ce.c
index d53ecebcf992..5535f0348499 100644
--- a/sys/contrib/dev/athk/ath10k/ce.c
+++ b/sys/contrib/dev/athk/ath10k/ce.c
@@ -1461,8 +1461,7 @@ ath10k_ce_alloc_src_ring(struct ath10k *ar, unsigned int ce_id,
 
 	nentries = roundup_pow_of_two(nentries);
 
-	src_ring = kzalloc(struct_size(src_ring, per_transfer_context,
-				       nentries), GFP_KERNEL);
+	src_ring = kzalloc_flex(*src_ring, per_transfer_context, nentries);
 	if (src_ring == NULL)
 		return ERR_PTR(-ENOMEM);
 
@@ -1519,8 +1518,7 @@ ath10k_ce_alloc_src_ring_64(struct ath10k *ar, unsigned int ce_id,
 
 	nentries = roundup_pow_of_two(nentries);
 
-	src_ring = kzalloc(struct_size(src_ring, per_transfer_context,
-				       nentries), GFP_KERNEL);
+	src_ring = kzalloc_flex(*src_ring, per_transfer_context, nentries);
 	if (!src_ring)
 		return ERR_PTR(-ENOMEM);
 
@@ -1575,8 +1573,7 @@ ath10k_ce_alloc_dest_ring(struct ath10k *ar, unsigned int ce_id,
 
 	nentries = roundup_pow_of_two(attr->dest_nentries);
 
-	dest_ring = kzalloc(struct_size(dest_ring, per_transfer_context,
-					nentries), GFP_KERNEL);
+	dest_ring = kzalloc_flex(*dest_ring, per_transfer_context, nentries);
 	if (dest_ring == NULL)
 		return ERR_PTR(-ENOMEM);
 
@@ -1619,8 +1616,7 @@ ath10k_ce_alloc_dest_ring_64(struct ath10k *ar, unsigned int ce_id,
 
 	nentries = roundup_pow_of_two(attr->dest_nentries);
 
-	dest_ring = kzalloc(struct_size(dest_ring, per_transfer_context,
-					nentries), GFP_KERNEL);
+	dest_ring = kzalloc_flex(*dest_ring, per_transfer_context, nentries);
 	if (!dest_ring)
 		return ERR_PTR(-ENOMEM);
 
diff --git a/sys/contrib/dev/athk/ath10k/htt_rx.c b/sys/contrib/dev/athk/ath10k/htt_rx.c
index d73369ffb697..b7bf6a225f58 100644
--- a/sys/contrib/dev/athk/ath10k/htt_rx.c
+++ b/sys/contrib/dev/athk/ath10k/htt_rx.c
@@ -820,8 +820,7 @@ int ath10k_htt_rx_alloc(struct ath10k_htt *htt)
 	}
 
 	htt->rx_ring.netbufs_ring =
-		kcalloc(htt->rx_ring.size, sizeof(struct sk_buff *),
-			GFP_KERNEL);
+		kzalloc_objs(struct sk_buff *, htt->rx_ring.size);
 	if (!htt->rx_ring.netbufs_ring)
 		goto err_netbuf;
 
diff --git a/sys/contrib/dev/athk/ath10k/mac.c b/sys/contrib/dev/athk/ath10k/mac.c
index d8e6bd2d277d..51ba60b9c237 100644
--- a/sys/contrib/dev/athk/ath10k/mac.c
+++ b/sys/contrib/dev/athk/ath10k/mac.c
@@ -6443,7 +6443,7 @@ static int ath10k_hw_scan(struct ieee80211_hw *hw,
 	if (ret)
 		goto exit;
 
-	arg = kzalloc(sizeof(*arg), GFP_KERNEL);
+	arg = kzalloc_obj(*arg);
 	if (!arg) {
 		ret = -ENOMEM;
 		goto exit;
@@ -7571,8 +7571,7 @@ static int ath10k_sta_state(struct ieee80211_hw *hw,
 		}
 
 		if (ath10k_debug_is_extd_tx_stats_enabled(ar)) {
-			arsta->tx_stats = kzalloc(sizeof(*arsta->tx_stats),
-						  GFP_KERNEL);
+			arsta->tx_stats = kzalloc_obj(*arsta->tx_stats);
 			if (!arsta->tx_stats) {
 				ath10k_mac_dec_num_stations(arvif, sta);
 				ret = -ENOMEM;
@@ -7984,7 +7983,7 @@ static int ath10k_remain_on_channel(struct ieee80211_hw *hw,
 
 	scan_time_msec = ar->hw->wiphy->max_remain_on_channel_duration * 2;
 
-	arg = kzalloc(sizeof(*arg), GFP_KERNEL);
+	arg = kzalloc_obj(*arg);
 	if (!arg) {
 		ret = -ENOMEM;
 		goto exit;
@@ -8974,8 +8973,7 @@ ath10k_mac_op_change_chanctx(struct ieee80211_hw *hw,
 		if (arg.n_vifs == 0)
 			goto radar;
 
-		arg.vifs = kcalloc(arg.n_vifs, sizeof(arg.vifs[0]),
-				   GFP_KERNEL);
+		arg.vifs = kzalloc_objs(arg.vifs[0], arg.n_vifs);
 		if (!arg.vifs)
 			goto radar;
 
diff --git a/sys/contrib/dev/athk/ath10k/qmi.c b/sys/contrib/dev/athk/ath10k/qmi.c
index 8275345631a0..eebd78e7ff6b 100644
--- a/sys/contrib/dev/athk/ath10k/qmi.c
+++ b/sys/contrib/dev/athk/ath10k/qmi.c
@@ -245,7 +245,7 @@ static int ath10k_qmi_bdf_dnld_send_sync(struct ath10k_qmi *qmi)
 	const u8 *temp;
 	int ret;
 
-	req = kzalloc(sizeof(*req), GFP_KERNEL);
+	req = kzalloc_obj(*req);
 	if (!req)
 		return -ENOMEM;
 
@@ -437,7 +437,7 @@ ath10k_qmi_cfg_send_sync_msg(struct ath10k *ar,
 	int ret;
 	u32 i;
 
-	req = kzalloc(sizeof(*req), GFP_KERNEL);
+	req = kzalloc_obj(*req);
 	if (!req)
 		return -ENOMEM;
 
@@ -578,7 +578,7 @@ static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi)
 	struct qmi_txn txn;
 	int ret;
 
-	resp = kzalloc(sizeof(*resp), GFP_KERNEL);
+	resp = kzalloc_obj(*resp);
 	if (!resp)
 		return -ENOMEM;
 
@@ -877,7 +877,7 @@ ath10k_qmi_driver_event_post(struct ath10k_qmi *qmi,
 {
 	struct ath10k_qmi_driver_event *event;
 
-	event = kzalloc(sizeof(*event), GFP_ATOMIC);
+	event = kzalloc_obj(*event, GFP_ATOMIC);
 	if (!event)
 		return -ENOMEM;
 
@@ -1075,7 +1075,7 @@ int ath10k_qmi_init(struct ath10k *ar, u32 msa_size)
 	struct ath10k_qmi *qmi;
 	int ret;
 
-	qmi = kzalloc(sizeof(*qmi), GFP_KERNEL);
+	qmi = kzalloc_obj(*qmi);
 	if (!qmi)
 		return -ENOMEM;
 
diff --git a/sys/contrib/dev/athk/ath10k/sdio.c b/sys/contrib/dev/athk/ath10k/sdio.c
index c06d50db40b8..43a6b1ba8fb8 100644
--- a/sys/contrib/dev/athk/ath10k/sdio.c
+++ b/sys/contrib/dev/athk/ath10k/sdio.c
@@ -246,7 +246,7 @@ static int ath10k_sdio_writesb32(struct ath10k *ar, u32 addr, u32 val)
 	__le32 *buf;
 	int ret;
 
-	buf = kzalloc(sizeof(*buf), GFP_KERNEL);
+	buf = kzalloc_obj(*buf);
 	if (!buf)
 		return -ENOMEM;
 
@@ -1766,7 +1766,7 @@ static int ath10k_sdio_diag_read32(struct ath10k *ar, u32 address,
 	__le32 *val;
 	int ret;
 
-	val = kzalloc(sizeof(*val), GFP_KERNEL);
+	val = kzalloc_obj(*val);
 	if (!val)
 		return -ENOMEM;
 
@@ -2487,7 +2487,11 @@ void ath10k_sdio_fw_crashed_dump(struct ath10k *ar)
 	if (fast_dump)
 		ath10k_bmi_start(ar);
 
+	mutex_lock(&ar->dump_mutex);
+
+	spin_lock_bh(&ar->data_lock);
 	ar->stats.fw_crash_counter++;
+	spin_unlock_bh(&ar->data_lock);
 
 	ath10k_sdio_disable_intrs(ar);
 
@@ -2505,6 +2509,8 @@ void ath10k_sdio_fw_crashed_dump(struct ath10k *ar)
 
 	ath10k_sdio_enable_intrs(ar);
 
+	mutex_unlock(&ar->dump_mutex);
+
 	ath10k_core_start_recovery(ar);
 }
 
diff --git a/sys/contrib/dev/athk/ath10k/snoc.c b/sys/contrib/dev/athk/ath10k/snoc.c
index b3f6424c17d3..f72f236fb9eb 100644
--- a/sys/contrib/dev/athk/ath10k/snoc.c
+++ b/sys/contrib/dev/athk/ath10k/snoc.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: ISC
 /*
  * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
  */
 
 #include <linux/bits.h>
@@ -11,6 +12,7 @@
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/property.h>
+#include <linux/pwrseq/consumer.h>
 #include <linux/regulator/consumer.h>
 #include <linux/remoteproc/qcom_rproc.h>
 #include <linux/of_reserved_mem.h>
@@ -1023,10 +1025,14 @@ static int ath10k_hw_power_on(struct ath10k *ar)
 
 	ath10k_dbg(ar, ATH10K_DBG_SNOC, "soc power on\n");
 
-	ret = regulator_bulk_enable(ar_snoc->num_vregs, ar_snoc->vregs);
+	ret = pwrseq_power_on(ar_snoc->pwrseq);
 	if (ret)
 		return ret;
 
+	ret = regulator_bulk_enable(ar_snoc->num_vregs, ar_snoc->vregs);
+	if (ret)
+		goto pwrseq_off;
+
 	ret = clk_bulk_prepare_enable(ar_snoc->num_clks, ar_snoc->clks);
 	if (ret)
 		goto vreg_off;
@@ -1035,18 +1041,28 @@ static int ath10k_hw_power_on(struct ath10k *ar)
 
 vreg_off:
 	regulator_bulk_disable(ar_snoc->num_vregs, ar_snoc->vregs);
+pwrseq_off:
+	pwrseq_power_off(ar_snoc->pwrseq);
+
 	return ret;
 }
 
 static int ath10k_hw_power_off(struct ath10k *ar)
 {
 	struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);
+	int ret_seq = 0;
+	int ret_vreg;
 
 	ath10k_dbg(ar, ATH10K_DBG_SNOC, "soc power off\n");
 
 	clk_bulk_disable_unprepare(ar_snoc->num_clks, ar_snoc->clks);
 
-	return regulator_bulk_disable(ar_snoc->num_vregs, ar_snoc->vregs);
+	ret_vreg = regulator_bulk_disable(ar_snoc->num_vregs, ar_snoc->vregs);
+
+	if (ar_snoc->pwrseq)
+		ret_seq = pwrseq_power_off(ar_snoc->pwrseq);
+
+	return ret_vreg ? : ret_seq;
 }
 
 static void ath10k_snoc_wlan_disable(struct ath10k *ar)
@@ -1762,7 +1778,38 @@ static int ath10k_snoc_probe(struct platform_device *pdev)
 		goto err_release_resource;
 	}
 
-	ar_snoc->num_vregs = ARRAY_SIZE(ath10k_regulators);
+	/*
+	 * devm_pwrseq_get() can return -EPROBE_DEFER in two cases:
+	 * - it is not supposed to be used
+	 * - it is supposed to be used, but the driver hasn't probed yet.
+	 *
+	 * There is no simple way to distinguish between these two cases, but:
+	 * - if it is not supposed to be used, then regulator_bulk_get() will
+	 *   return all regulators as expected, continuing the probe
+	 * - if it is supposed to be used, but wasn't probed yet, we will get
+	 *   -EPROBE_DEFER from regulator_bulk_get() too.
+	 *
+	 * For backwards compatibility with DTs specifying regulators directly
+	 * rather than using the PMU device, ignore the defer error from
+	 * pwrseq.
+	 */
+	ar_snoc->pwrseq = devm_pwrseq_get(&pdev->dev, "wlan");
+	if (IS_ERR(ar_snoc->pwrseq)) {
+		ret = PTR_ERR(ar_snoc->pwrseq);
+		ar_snoc->pwrseq = NULL;
+		if (ret != -EPROBE_DEFER)
+			goto err_free_irq;
+
+		ar_snoc->num_vregs = ARRAY_SIZE(ath10k_regulators);
+	} else {
+		/*
+		 * The first regulator (vdd-0.8-cx-mx) is used to power on part
+		 * of the SoC rather than the PMU on WCN399x, the rest are
+		 * handled via pwrseq.
+		 */
+		ar_snoc->num_vregs = 1;
+	}
+
 	ar_snoc->vregs = devm_kcalloc(&pdev->dev, ar_snoc->num_vregs,
 				      sizeof(*ar_snoc->vregs), GFP_KERNEL);
 	if (!ar_snoc->vregs) {
diff --git a/sys/contrib/dev/athk/ath10k/snoc.h b/sys/contrib/dev/athk/ath10k/snoc.h
index d4bce1707696..1ecae34687c2 100644
--- a/sys/contrib/dev/athk/ath10k/snoc.h
+++ b/sys/contrib/dev/athk/ath10k/snoc.h
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: ISC */
 /*
  * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
  */
 
 #ifndef _SNOC_H_
@@ -53,6 +54,7 @@ enum ath10k_snoc_flags {
 };
 
 struct clk_bulk_data;
+struct pwrseq_desc;
 struct regulator_bulk_data;
 
 struct ath10k_snoc {
@@ -73,6 +75,7 @@ struct ath10k_snoc {
 	struct ath10k_snoc_ce_irq ce_irqs[CE_COUNT_MAX];
 	struct ath10k_ce ce;
 	struct timer_list rx_post_retry;
+	struct pwrseq_desc *pwrseq;
 	struct regulator_bulk_data *vregs;
 	size_t num_vregs;
 	struct clk_bulk_data *clks;
diff --git a/sys/contrib/dev/athk/ath10k/txrx.c b/sys/contrib/dev/athk/ath10k/txrx.c
index 493bfb410aff..50a3498a0bfd 100644
--- a/sys/contrib/dev/athk/ath10k/txrx.c
+++ b/sys/contrib/dev/athk/ath10k/txrx.c
@@ -230,7 +230,7 @@ void ath10k_peer_map_event(struct ath10k_htt *htt,
 	spin_lock_bh(&ar->data_lock);
 	peer = ath10k_peer_find(ar, ev->vdev_id, ev->addr);
 	if (!peer) {
-		peer = kzalloc(sizeof(*peer), GFP_ATOMIC);
+		peer = kzalloc_obj(*peer, GFP_ATOMIC);
 		if (!peer)
 			goto exit;
 
diff --git a/sys/contrib/dev/athk/ath10k/usb.c b/sys/contrib/dev/athk/ath10k/usb.c
index a825d442fe33..a5934117a5d3 100644
--- a/sys/contrib/dev/athk/ath10k/usb.c
+++ b/sys/contrib/dev/athk/ath10k/usb.c
@@ -799,7 +799,7 @@ static int ath10k_usb_alloc_pipe_resources(struct ath10k *ar,
 	init_usb_anchor(&pipe->urb_submitted);
 
 	for (i = 0; i < urb_cnt; i++) {
-		urb_context = kzalloc(sizeof(*urb_context), GFP_KERNEL);
+		urb_context = kzalloc_obj(*urb_context);
 		if (!urb_context)
 			return -ENOMEM;
 
diff --git a/sys/contrib/dev/athk/ath10k/wmi-tlv.c b/sys/contrib/dev/athk/ath10k/wmi-tlv.c
index 6d498e6d6ea6..5a1f3d01f5e6 100644
--- a/sys/contrib/dev/athk/ath10k/wmi-tlv.c
+++ b/sys/contrib/dev/athk/ath10k/wmi-tlv.c
@@ -157,7 +157,7 @@ ath10k_wmi_tlv_parse_alloc(struct ath10k *ar, const void *ptr,
 	const void **tb;
 	int ret;
 
-	tb = kcalloc(WMI_TLV_TAG_MAX, sizeof(*tb), gfp);
+	tb = kzalloc_objs(*tb, WMI_TLV_TAG_MAX, gfp);
 	if (!tb)
 		return ERR_PTR(-ENOMEM);
 
@@ -1583,7 +1583,7 @@ static int ath10k_wmi_tlv_op_pull_fw_stats(struct ath10k *ar,
 		data += sizeof(*src);
 		data_len -= sizeof(*src);
 
-		dst = kzalloc(sizeof(*dst), GFP_ATOMIC);
+		dst = kzalloc_obj(*dst, GFP_ATOMIC);
 		if (!dst)
 			continue;
 
@@ -1610,7 +1610,7 @@ static int ath10k_wmi_tlv_op_pull_fw_stats(struct ath10k *ar,
 		data += sizeof(*src);
 		data_len -= sizeof(*src);
 
-		dst = kzalloc(sizeof(*dst), GFP_ATOMIC);
+		dst = kzalloc_obj(*dst, GFP_ATOMIC);
 		if (!dst)
 			continue;
 
@@ -1635,7 +1635,7 @@ static int ath10k_wmi_tlv_op_pull_fw_stats(struct ath10k *ar,
 		data += sizeof(*src);
 		data_len -= sizeof(*src);
 
-		dst = kzalloc(sizeof(*dst), GFP_ATOMIC);
+		dst = kzalloc_obj(*dst, GFP_ATOMIC);
 		if (!dst)
 			continue;
 
@@ -3292,7 +3292,7 @@ ath10k_wmi_mgmt_tx_alloc_msdu_id(struct ath10k *ar, struct sk_buff *skb,
 	struct ath10k_mgmt_tx_pkt_addr *pkt_addr;
 	int ret;
 
-	pkt_addr = kmalloc(sizeof(*pkt_addr), GFP_ATOMIC);
+	pkt_addr = kmalloc_obj(*pkt_addr, GFP_ATOMIC);
 	if (!pkt_addr)
 		return -ENOMEM;
 
diff --git a/sys/contrib/dev/athk/ath10k/wmi.c b/sys/contrib/dev/athk/ath10k/wmi.c
index 53c2563c8056..0f48ffde9cb9 100644
--- a/sys/contrib/dev/athk/ath10k/wmi.c
+++ b/sys/contrib/dev/athk/ath10k/wmi.c
@@ -3056,7 +3056,7 @@ static int ath10k_wmi_main_op_pull_fw_stats(struct ath10k *ar,
 		if (!skb_pull(skb, sizeof(*src)))
 			return -EPROTO;
 
-		dst = kzalloc(sizeof(*dst), GFP_ATOMIC);
+		dst = kzalloc_obj(*dst, GFP_ATOMIC);
 		if (!dst)
 			continue;
 
@@ -3077,7 +3077,7 @@ static int ath10k_wmi_main_op_pull_fw_stats(struct ath10k *ar,
 		if (!skb_pull(skb, sizeof(*src)))
 			return -EPROTO;
 
-		dst = kzalloc(sizeof(*dst), GFP_ATOMIC);
+		dst = kzalloc_obj(*dst, GFP_ATOMIC);
 		if (!dst)
 			continue;
 
@@ -3110,7 +3110,7 @@ static int ath10k_wmi_10x_op_pull_fw_stats(struct ath10k *ar,
 		if (!skb_pull(skb, sizeof(*src)))
 			return -EPROTO;
 
-		dst = kzalloc(sizeof(*dst), GFP_ATOMIC);
+		dst = kzalloc_obj(*dst, GFP_ATOMIC);
 		if (!dst)
 			continue;
 
@@ -3132,7 +3132,7 @@ static int ath10k_wmi_10x_op_pull_fw_stats(struct ath10k *ar,
 		if (!skb_pull(skb, sizeof(*src)))
 			return -EPROTO;
 
-		dst = kzalloc(sizeof(*dst), GFP_ATOMIC);
+		dst = kzalloc_obj(*dst, GFP_ATOMIC);
 		if (!dst)
 			continue;
 
@@ -3171,7 +3171,7 @@ static int ath10k_wmi_10_2_op_pull_fw_stats(struct ath10k *ar,
 		if (!skb_pull(skb, sizeof(*src)))
 			return -EPROTO;
 
-		dst = kzalloc(sizeof(*dst), GFP_ATOMIC);
+		dst = kzalloc_obj(*dst, GFP_ATOMIC);
 		if (!dst)
 			continue;
 
@@ -3208,7 +3208,7 @@ static int ath10k_wmi_10_2_op_pull_fw_stats(struct ath10k *ar,
 		if (!skb_pull(skb, sizeof(*src)))
 			return -EPROTO;
 
-		dst = kzalloc(sizeof(*dst), GFP_ATOMIC);
+		dst = kzalloc_obj(*dst, GFP_ATOMIC);
 		if (!dst)
 			continue;
 
@@ -3248,7 +3248,7 @@ static int ath10k_wmi_10_2_4_op_pull_fw_stats(struct ath10k *ar,
 		if (!skb_pull(skb, sizeof(*src)))
 			return -EPROTO;
 
-		dst = kzalloc(sizeof(*dst), GFP_ATOMIC);
+		dst = kzalloc_obj(*dst, GFP_ATOMIC);
 		if (!dst)
 			continue;
 
@@ -3291,7 +3291,7 @@ static int ath10k_wmi_10_2_4_op_pull_fw_stats(struct ath10k *ar,
 		if (!skb_pull(skb, stats_len))
 			return -EPROTO;
 
-		dst = kzalloc(sizeof(*dst), GFP_ATOMIC);
+		dst = kzalloc_obj(*dst, GFP_ATOMIC);
 		if (!dst)
 			continue;
 
@@ -3340,7 +3340,7 @@ static int ath10k_wmi_10_4_op_pull_fw_stats(struct ath10k *ar,
 		if (!skb_pull(skb, sizeof(*src)))
 			return -EPROTO;
 
-		dst = kzalloc(sizeof(*dst), GFP_ATOMIC);
+		dst = kzalloc_obj(*dst, GFP_ATOMIC);
 		if (!dst)
 			continue;
 
@@ -3386,7 +3386,7 @@ static int ath10k_wmi_10_4_op_pull_fw_stats(struct ath10k *ar,
 		if (!skb_pull(skb, sizeof(*src)))
 			return -EPROTO;
 
-		dst = kzalloc(sizeof(*dst), GFP_ATOMIC);
+		dst = kzalloc_obj(*dst, GFP_ATOMIC);
 		if (!dst)
 			continue;
 
@@ -3419,7 +3419,7 @@ static int ath10k_wmi_10_4_op_pull_fw_stats(struct ath10k *ar,
 			if (!skb_pull(skb, sizeof(*src)))
 				return -EPROTO;
 
-			dst = kzalloc(sizeof(*dst), GFP_ATOMIC);
+			dst = kzalloc_obj(*dst, GFP_ATOMIC);
 			if (!dst)
 				continue;
 
@@ -3439,7 +3439,7 @@ static int ath10k_wmi_10_4_op_pull_fw_stats(struct ath10k *ar,
 			if (!skb_pull(skb, sizeof(*src)))
 				return -EPROTO;
 
-			dst = kzalloc(sizeof(*dst), GFP_ATOMIC);
+			dst = kzalloc_obj(*dst, GFP_ATOMIC);
 			if (!dst)
 				continue;
 			ath10k_wmi_10_4_pull_vdev_stats(src, dst);
@@ -4981,7 +4981,7 @@ void ath10k_wmi_event_pdev_tpc_config(struct ath10k *ar, struct sk_buff *skb)
 		rate_max = WMI_TPC_RATE_MAX;
 	}
 
-	tpc_stats = kzalloc(sizeof(*tpc_stats), GFP_ATOMIC);
+	tpc_stats = kzalloc_obj(*tpc_stats, GFP_ATOMIC);
 	if (!tpc_stats)
 		return;
 
@@ -5237,7 +5237,7 @@ void ath10k_wmi_event_tpc_final_table(struct ath10k *ar, struct sk_buff *skb)
 		rate_max = WMI_TPC_FINAL_RATE_MAX;
 	}
 
-	tpc_stats = kzalloc(sizeof(*tpc_stats), GFP_ATOMIC);
+	tpc_stats = kzalloc_obj(*tpc_stats, GFP_ATOMIC);
 	if (!tpc_stats)
 		return;
 
@@ -5358,8 +5358,6 @@ ath10k_wmi_event_peer_sta_ps_state_chg(struct ath10k *ar, struct sk_buff *skb)
 	struct ath10k_sta *arsta;
 	u8 peer_addr[ETH_ALEN];
 
-	lockdep_assert_held(&ar->data_lock);
-
 	ev = (struct wmi_peer_sta_ps_state_chg_event *)skb->data;
 	ether_addr_copy(peer_addr, ev->peer_macaddr.addr);
 
@@ -5374,7 +5372,9 @@ ath10k_wmi_event_peer_sta_ps_state_chg(struct ath10k *ar, struct sk_buff *skb)
 	}
 
 	arsta = (struct ath10k_sta *)sta->drv_priv;
+	spin_lock_bh(&ar->data_lock);
 	arsta->peer_ps_state = __le32_to_cpu(ev->peer_ps_state);
+	spin_unlock_bh(&ar->data_lock);
 
 exit:
 	rcu_read_unlock();
diff --git a/sys/contrib/dev/athk/ath10k/wow.c b/sys/contrib/dev/athk/ath10k/wow.c
index aa7b2e703f3d..78653f257925 100644
--- a/sys/contrib/dev/athk/ath10k/wow.c
+++ b/sys/contrib/dev/athk/ath10k/wow.c
@@ -301,7 +301,7 @@ static int ath10k_vif_wow_set_wakeups(struct ath10k_vif *arvif,
 			struct wmi_pno_scan_req *pno;
 			int ret;
 
-			pno = kzalloc(sizeof(*pno), GFP_KERNEL);
+			pno = kzalloc_obj(*pno);
 			if (!pno)
 				return -ENOMEM;
 
@@ -413,7 +413,7 @@ static int ath10k_vif_wow_clean_nlo(struct ath10k_vif *arvif)
 		if (ar->nlo_enabled) {
 			struct wmi_pno_scan_req *pno;
 
-			pno = kzalloc(sizeof(*pno), GFP_KERNEL);
+			pno = kzalloc_obj(*pno);
 			if (!pno)
 				return -ENOMEM;
 


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69e938fa.27cb8.5a9919d2>