Synchronize the ath11k backports with the current ath-next tree.
All of the changes are various bugfixes, there is no new major feature.
Signed-off-by: Robert Marko <robimarko@gmail.com>
--- /dev/null
+From 72c8caf904aed2caed5d6e75233294b6159ddb5d Mon Sep 17 00:00:00 2001
+From: Aditya Kumar Singh <quic_adisi@quicinc.com>
+Date: Wed, 26 Jul 2023 10:16:24 +0530
+Subject: [PATCH 1/5] wifi: ath11k: fix band selection for ppdu received in
+ channel 177 of 5 GHz
+
+5 GHz band channel 177 support was added with the commit e5e94d10c856 ("wifi:
+ath11k: add channel 177 into 5 GHz channel list"). However, during processing
+for the received ppdu in ath11k_dp_rx_h_ppdu(), channel number is checked only
+till 173. This leads to driver code checking for channel and then fetching the
+band from it which is extra effort since firmware has already given the channel
+number in the metadata.
+
+Fix this issue by checking the channel number till 177 since we support
+it now.
+
+Found via code review. Compile tested only.
+
+Fixes: e5e94d10c856 ("wifi: ath11k: add channel 177 into 5 GHz channel list")
+Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
+Link: https://lore.kernel.org/r/20230726044624.20507-1-quic_adisi@quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
+@@ -2408,7 +2408,7 @@ static void ath11k_dp_rx_h_ppdu(struct a
+ rx_status->freq = center_freq;
+ } else if (channel_num >= 1 && channel_num <= 14) {
+ rx_status->band = NL80211_BAND_2GHZ;
+- } else if (channel_num >= 36 && channel_num <= 173) {
++ } else if (channel_num >= 36 && channel_num <= 177) {
+ rx_status->band = NL80211_BAND_5GHZ;
+ } else {
+ spin_lock_bh(&ar->data_lock);
--- /dev/null
+From 6f092c98dcfa1e4cf37d45f9b8e4d4a3cbeb79d4 Mon Sep 17 00:00:00 2001
+From: Dmitry Antipov <dmantipov@yandex.ru>
+Date: Wed, 26 Jul 2023 12:21:02 +0300
+Subject: [PATCH 2/5] wifi: ath11k: simplify
+ ath11k_mac_validate_vht_he_fixed_rate_settings()
+
+In ath11k_mac_validate_vht_he_fixed_rate_settings() ar->ab->peers
+list is not altered so list_for_each_entry() should be safe.
+
+Compile tested only.
+
+Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
+Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
+Link: https://lore.kernel.org/r/20230726092113.78794-1-dmantipov@yandex.ru
+---
+ drivers/net/wireless/ath/ath11k/mac.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/mac.c
++++ b/drivers/net/wireless/ath/ath11k/mac.c
+@@ -8255,7 +8255,7 @@ ath11k_mac_validate_vht_he_fixed_rate_se
+ const struct cfg80211_bitrate_mask *mask)
+ {
+ bool he_fixed_rate = false, vht_fixed_rate = false;
+- struct ath11k_peer *peer, *tmp;
++ struct ath11k_peer *peer;
+ const u16 *vht_mcs_mask, *he_mcs_mask;
+ struct ieee80211_link_sta *deflink;
+ u8 vht_nss, he_nss;
+@@ -8278,7 +8278,7 @@ ath11k_mac_validate_vht_he_fixed_rate_se
+
+ rcu_read_lock();
+ spin_lock_bh(&ar->ab->base_lock);
+- list_for_each_entry_safe(peer, tmp, &ar->ab->peers, list) {
++ list_for_each_entry(peer, &ar->ab->peers, list) {
+ if (peer->sta) {
+ deflink = &peer->sta->deflink;
+
--- /dev/null
+From 011e5a3052a22d3758d17442bf0c04c68bf79bea Mon Sep 17 00:00:00 2001
+From: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
+Date: Wed, 26 Jul 2023 19:40:30 +0530
+Subject: [PATCH 3/5] wifi: ath11k: Split coldboot calibration hw_param
+
+QCN9074 enables coldboot calibration only in Factory Test Mode (FTM).
+Hence, split cold_boot_calib to two hw_params for mission and FTM
+mode.
+
+Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
+
+Signed-off-by: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
+Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
+Link: https://lore.kernel.org/r/20230726141032.3061-2-quic_rajkbhag@quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/ahb.c | 3 +--
+ drivers/net/wireless/ath/ath11k/core.c | 36 ++++++++++++++++++++------
+ drivers/net/wireless/ath/ath11k/core.h | 1 +
+ drivers/net/wireless/ath/ath11k/hw.h | 3 ++-
+ drivers/net/wireless/ath/ath11k/qmi.c | 6 ++---
+ 5 files changed, 35 insertions(+), 14 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/ahb.c
++++ b/drivers/net/wireless/ath/ath11k/ahb.c
+@@ -422,8 +422,7 @@ static int ath11k_ahb_fwreset_from_cold_
+ {
+ int timeout;
+
+- if (ath11k_cold_boot_cal == 0 || ab->qmi.cal_done ||
+- ab->hw_params.cold_boot_calib == 0 ||
++ if (!ath11k_core_coldboot_cal_support(ab) || ab->qmi.cal_done ||
+ ab->hw_params.cbcal_restart_fw == 0)
+ return 0;
+
+--- a/drivers/net/wireless/ath/ath11k/core.c
++++ b/drivers/net/wireless/ath/ath11k/core.c
+@@ -86,7 +86,8 @@ static const struct ath11k_hw_params ath
+ .supports_shadow_regs = false,
+ .idle_ps = false,
+ .supports_sta_ps = false,
+- .cold_boot_calib = true,
++ .coldboot_cal_mm = true,
++ .coldboot_cal_ftm = true,
+ .cbcal_restart_fw = true,
+ .fw_mem_mode = 0,
+ .num_vdevs = 16 + 1,
+@@ -167,7 +168,8 @@ static const struct ath11k_hw_params ath
+ .supports_shadow_regs = false,
+ .idle_ps = false,
+ .supports_sta_ps = false,
+- .cold_boot_calib = true,
++ .coldboot_cal_mm = true,
++ .coldboot_cal_ftm = true,
+ .cbcal_restart_fw = true,
+ .fw_mem_mode = 0,
+ .num_vdevs = 16 + 1,
+@@ -248,7 +250,8 @@ static const struct ath11k_hw_params ath
+ .supports_shadow_regs = true,
+ .idle_ps = true,
+ .supports_sta_ps = true,
+- .cold_boot_calib = false,
++ .coldboot_cal_mm = false,
++ .coldboot_cal_ftm = false,
+ .cbcal_restart_fw = false,
+ .fw_mem_mode = 0,
+ .num_vdevs = 16 + 1,
+@@ -332,7 +335,8 @@ static const struct ath11k_hw_params ath
+ .supports_shadow_regs = false,
+ .idle_ps = false,
+ .supports_sta_ps = false,
+- .cold_boot_calib = false,
++ .coldboot_cal_mm = false,
++ .coldboot_cal_ftm = false,
+ .cbcal_restart_fw = false,
+ .fw_mem_mode = 2,
+ .num_vdevs = 8,
+@@ -413,7 +417,8 @@ static const struct ath11k_hw_params ath
+ .supports_shadow_regs = true,
+ .idle_ps = true,
+ .supports_sta_ps = true,
+- .cold_boot_calib = false,
++ .coldboot_cal_mm = false,
++ .coldboot_cal_ftm = false,
+ .cbcal_restart_fw = false,
+ .fw_mem_mode = 0,
+ .num_vdevs = 16 + 1,
+@@ -495,7 +500,8 @@ static const struct ath11k_hw_params ath
+ .supports_shadow_regs = true,
+ .idle_ps = true,
+ .supports_sta_ps = true,
+- .cold_boot_calib = false,
++ .coldboot_cal_mm = false,
++ .coldboot_cal_ftm = false,
+ .cbcal_restart_fw = false,
+ .fw_mem_mode = 0,
+ .num_vdevs = 16 + 1,
+@@ -578,7 +584,8 @@ static const struct ath11k_hw_params ath
+ .supports_shadow_regs = true,
+ .idle_ps = true,
+ .supports_sta_ps = true,
+- .cold_boot_calib = true,
++ .coldboot_cal_mm = true,
++ .coldboot_cal_ftm = true,
+ .cbcal_restart_fw = false,
+ .fw_mem_mode = 0,
+ .num_vdevs = 16 + 1,
+@@ -667,7 +674,8 @@ static const struct ath11k_hw_params ath
+ .supports_suspend = false,
+ .hal_params = &ath11k_hw_hal_params_ipq8074,
+ .single_pdev_only = false,
+- .cold_boot_calib = true,
++ .coldboot_cal_mm = true,
++ .coldboot_cal_ftm = true,
+ .cbcal_restart_fw = true,
+ .fix_l1ss = true,
+ .supports_dynamic_smps_6ghz = false,
+@@ -749,6 +757,18 @@ void ath11k_fw_stats_free(struct ath11k_
+ ath11k_fw_stats_bcn_free(&stats->bcn);
+ }
+
++bool ath11k_core_coldboot_cal_support(struct ath11k_base *ab)
++{
++ if (!ath11k_cold_boot_cal)
++ return false;
++
++ if (ath11k_ftm_mode)
++ return ab->hw_params.coldboot_cal_ftm;
++
++ else
++ return ab->hw_params.coldboot_cal_mm;
++}
++
+ int ath11k_core_suspend(struct ath11k_base *ab)
+ {
+ int ret;
+--- a/drivers/net/wireless/ath/ath11k/core.h
++++ b/drivers/net/wireless/ath/ath11k/core.h
+@@ -1186,6 +1186,7 @@ void ath11k_core_halt(struct ath11k *ar)
+ int ath11k_core_resume(struct ath11k_base *ab);
+ int ath11k_core_suspend(struct ath11k_base *ab);
+ void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab);
++bool ath11k_core_coldboot_cal_support(struct ath11k_base *ab);
+
+ const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab,
+ const char *filename);
+--- a/drivers/net/wireless/ath/ath11k/hw.h
++++ b/drivers/net/wireless/ath/ath11k/hw.h
+@@ -187,7 +187,8 @@ struct ath11k_hw_params {
+ bool supports_shadow_regs;
+ bool idle_ps;
+ bool supports_sta_ps;
+- bool cold_boot_calib;
++ bool coldboot_cal_mm;
++ bool coldboot_cal_ftm;
+ bool cbcal_restart_fw;
+ int fw_mem_mode;
+ u32 num_vdevs;
+--- a/drivers/net/wireless/ath/ath11k/qmi.c
++++ b/drivers/net/wireless/ath/ath11k/qmi.c
+@@ -2079,7 +2079,7 @@ static int ath11k_qmi_assign_target_mem_
+ return -EINVAL;
+ }
+
+- if (ath11k_cold_boot_cal && ab->hw_params.cold_boot_calib) {
++ if (ath11k_core_coldboot_cal_support(ab)) {
+ if (hremote_node) {
+ ab->qmi.target_mem[idx].paddr =
+ res.start + host_ddr_sz;
+@@ -3209,8 +3209,8 @@ static void ath11k_qmi_driver_event_work
+ break;
+ }
+
+- if (ath11k_cold_boot_cal && ab->qmi.cal_done == 0 &&
+- ab->hw_params.cold_boot_calib) {
++ if (ab->qmi.cal_done == 0 &&
++ ath11k_core_coldboot_cal_support(ab)) {
+ ath11k_qmi_process_coldboot_calibration(ab);
+ } else {
+ clear_bit(ATH11K_FLAG_CRASH_FLUSH,
--- /dev/null
+From bdfc967bf5fcd762473a01d39edb81f1165ba290 Mon Sep 17 00:00:00 2001
+From: Anilkumar Kolli <quic_akolli@quicinc.com>
+Date: Wed, 26 Jul 2023 19:40:31 +0530
+Subject: [PATCH 4/5] wifi: ath11k: Add coldboot calibration support for
+ QCN9074
+
+QCN9074 supports 6 GHz, which has increased number of channels
+compared to 5 GHz/2 GHz. So, to support coldboot calibration in
+QCN9074 ATH11K_COLD_BOOT_FW_RESET_DELAY extended to 60 seconds. To
+avoid code redundancy, fwreset_from_cold_boot moved to QMI and made
+common for both ahb and pci. Coldboot calibration is enabled only in
+FTM mode for QCN9074. QCN9074 requires firmware restart after coldboot,
+hence enable cbcal_restart_fw in hw_params.
+
+This support can be enabled/disabled using hw params for different
+hardware. Currently it is not enabled for QCA6390.
+
+Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
+
+Signed-off-by: Anilkumar Kolli <quic_akolli@quicinc.com>
+Signed-off-by: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
+Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
+Link: https://lore.kernel.org/r/20230726141032.3061-3-quic_rajkbhag@quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/ahb.c | 28 ++------------------------
+ drivers/net/wireless/ath/ath11k/core.c | 4 ++--
+ drivers/net/wireless/ath/ath11k/pci.c | 2 ++
+ drivers/net/wireless/ath/ath11k/qmi.c | 28 ++++++++++++++++++++++++++
+ drivers/net/wireless/ath/ath11k/qmi.h | 3 ++-
+ 5 files changed, 36 insertions(+), 29 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/ahb.c
++++ b/drivers/net/wireless/ath/ath11k/ahb.c
+@@ -14,6 +14,7 @@
+ #include "ahb.h"
+ #include "debug.h"
+ #include "hif.h"
++#include "qmi.h"
+ #include <linux/remoteproc.h>
+ #include "pcic.h"
+ #include <linux/soc/qcom/smem.h>
+@@ -418,31 +419,6 @@ static void ath11k_ahb_power_down(struct
+ rproc_shutdown(ab_ahb->tgt_rproc);
+ }
+
+-static int ath11k_ahb_fwreset_from_cold_boot(struct ath11k_base *ab)
+-{
+- int timeout;
+-
+- if (!ath11k_core_coldboot_cal_support(ab) || ab->qmi.cal_done ||
+- ab->hw_params.cbcal_restart_fw == 0)
+- return 0;
+-
+- ath11k_dbg(ab, ATH11K_DBG_AHB, "wait for cold boot done\n");
+- timeout = wait_event_timeout(ab->qmi.cold_boot_waitq,
+- (ab->qmi.cal_done == 1),
+- ATH11K_COLD_BOOT_FW_RESET_DELAY);
+- if (timeout <= 0) {
+- ath11k_cold_boot_cal = 0;
+- ath11k_warn(ab, "Coldboot Calibration failed timed out\n");
+- }
+-
+- /* reset the firmware */
+- ath11k_ahb_power_down(ab);
+- ath11k_ahb_power_up(ab);
+-
+- ath11k_dbg(ab, ATH11K_DBG_AHB, "exited from cold boot mode\n");
+- return 0;
+-}
+-
+ static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab)
+ {
+ struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg;
+@@ -1225,7 +1201,7 @@ static int ath11k_ahb_probe(struct platf
+ goto err_ce_free;
+ }
+
+- ath11k_ahb_fwreset_from_cold_boot(ab);
++ ath11k_qmi_fwreset_from_cold_boot(ab);
+
+ return 0;
+
+--- a/drivers/net/wireless/ath/ath11k/core.c
++++ b/drivers/net/wireless/ath/ath11k/core.c
+@@ -336,8 +336,8 @@ static const struct ath11k_hw_params ath
+ .idle_ps = false,
+ .supports_sta_ps = false,
+ .coldboot_cal_mm = false,
+- .coldboot_cal_ftm = false,
+- .cbcal_restart_fw = false,
++ .coldboot_cal_ftm = true,
++ .cbcal_restart_fw = true,
+ .fw_mem_mode = 2,
+ .num_vdevs = 8,
+ .num_peers = 128,
+--- a/drivers/net/wireless/ath/ath11k/pci.c
++++ b/drivers/net/wireless/ath/ath11k/pci.c
+@@ -15,6 +15,7 @@
+ #include "mhi.h"
+ #include "debug.h"
+ #include "pcic.h"
++#include "qmi.h"
+
+ #define ATH11K_PCI_BAR_NUM 0
+ #define ATH11K_PCI_DMA_MASK 32
+@@ -897,6 +898,7 @@ unsupported_wcn6855_soc:
+ ath11k_err(ab, "failed to init core: %d\n", ret);
+ goto err_irq_affinity_cleanup;
+ }
++ ath11k_qmi_fwreset_from_cold_boot(ab);
+ return 0;
+
+ err_irq_affinity_cleanup:
+--- a/drivers/net/wireless/ath/ath11k/qmi.c
++++ b/drivers/net/wireless/ath/ath11k/qmi.c
+@@ -9,6 +9,7 @@
+ #include "qmi.h"
+ #include "core.h"
+ #include "debug.h"
++#include "hif.h"
+ #include <linux/of.h>
+ #include <linux/of_address.h>
+ #include <linux/ioport.h>
+@@ -2839,6 +2840,33 @@ int ath11k_qmi_firmware_start(struct ath
+ return 0;
+ }
+
++int ath11k_qmi_fwreset_from_cold_boot(struct ath11k_base *ab)
++{
++ int timeout;
++
++ if (!ath11k_core_coldboot_cal_support(ab) || ab->qmi.cal_done ||
++ ab->hw_params.cbcal_restart_fw == 0)
++ return 0;
++
++ ath11k_dbg(ab, ATH11K_DBG_QMI, "wait for cold boot done\n");
++
++ timeout = wait_event_timeout(ab->qmi.cold_boot_waitq,
++ (ab->qmi.cal_done == 1),
++ ATH11K_COLD_BOOT_FW_RESET_DELAY);
++
++ if (timeout <= 0) {
++ ath11k_warn(ab, "Coldboot Calibration timed out\n");
++ return -ETIMEDOUT;
++ }
++
++ /* reset the firmware */
++ ath11k_hif_power_down(ab);
++ ath11k_hif_power_up(ab);
++ ath11k_dbg(ab, ATH11K_DBG_QMI, "exit wait for cold boot done\n");
++ return 0;
++}
++EXPORT_SYMBOL(ath11k_qmi_fwreset_from_cold_boot);
++
+ static int ath11k_qmi_process_coldboot_calibration(struct ath11k_base *ab)
+ {
+ int timeout;
+--- a/drivers/net/wireless/ath/ath11k/qmi.h
++++ b/drivers/net/wireless/ath/ath11k/qmi.h
+@@ -37,7 +37,7 @@
+
+ #define QMI_WLANFW_MAX_DATA_SIZE_V01 6144
+ #define ATH11K_FIRMWARE_MODE_OFF 4
+-#define ATH11K_COLD_BOOT_FW_RESET_DELAY (40 * HZ)
++#define ATH11K_COLD_BOOT_FW_RESET_DELAY (60 * HZ)
+
+ #define ATH11K_QMI_DEVICE_BAR_SIZE 0x200000
+
+@@ -519,5 +519,6 @@ void ath11k_qmi_msg_recv_work(struct wor
+ void ath11k_qmi_deinit_service(struct ath11k_base *ab);
+ int ath11k_qmi_init_service(struct ath11k_base *ab);
+ void ath11k_qmi_free_resource(struct ath11k_base *ab);
++int ath11k_qmi_fwreset_from_cold_boot(struct ath11k_base *ab);
+
+ #endif
--- /dev/null
+From 13329d0cb7212b058bd8451a99d215a8f97645ea Mon Sep 17 00:00:00 2001
+From: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
+Date: Wed, 26 Jul 2023 19:40:32 +0530
+Subject: [PATCH 5/5] wifi: ath11k: Remove cal_done check during probe
+
+In some race conditions, calibration done QMI message is received even
+before host wait starts for calibration to be done.
+Due to this, resetting firmware was not performed after calibration.
+
+Hence, remove cal_done check in ath11k_qmi_fwreset_from_cold_boot()
+as this is called only from probe.
+
+Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
+
+Signed-off-by: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
+Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
+Link: https://lore.kernel.org/r/20230726141032.3061-4-quic_rajkbhag@quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/qmi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/ath/ath11k/qmi.c
++++ b/drivers/net/wireless/ath/ath11k/qmi.c
+@@ -2844,7 +2844,7 @@ int ath11k_qmi_fwreset_from_cold_boot(st
+ {
+ int timeout;
+
+- if (!ath11k_core_coldboot_cal_support(ab) || ab->qmi.cal_done ||
++ if (!ath11k_core_coldboot_cal_support(ab) ||
+ ab->hw_params.cbcal_restart_fw == 0)
+ return 0;
+
--- /dev/null
+From 400ece6c7f346b0a30867bd00b03b5b2563d4357 Mon Sep 17 00:00:00 2001
+From: Sven Eckelmann <sven@narfation.org>
+Date: Tue, 22 Aug 2023 16:42:24 +0300
+Subject: [PATCH] wifi: ath11k: Don't drop tx_status when peer cannot be found
+
+When a station idles for a long time, hostapd will try to send a QoS Null
+frame to the station as "poll". NL80211_CMD_PROBE_CLIENT is used for this
+purpose. And the skb will be added to ack_status_frame - waiting for a
+completion via ieee80211_report_ack_skb().
+
+But when the peer was already removed before the tx_complete arrives, the
+peer will be missing. And when using dev_kfree_skb_any (instead of going
+through mac80211), the entry will stay inside ack_status_frames. This IDR
+will therefore run full after 8K request were generated for such clients.
+At this point, the access point will then just stall and not allow any new
+clients because idr_alloc() for ack_status_frame will fail.
+
+ieee80211_free_txskb() on the other hand will (when required) call
+ieee80211_report_ack_skb() and make sure that (when required) remove the
+entry from the ack_status_frame.
+
+Tested-on: IPQ6018 hw1.0 WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
+
+Fixes: 6257c702264c ("wifi: ath11k: fix tx status reporting in encap offload mode")
+Fixes: 94739d45c388 ("ath11k: switch to using ieee80211_tx_status_ext()")
+Cc: stable@vger.kernel.org
+Signed-off-by: Sven Eckelmann <sven@narfation.org>
+Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
+Link: https://lore.kernel.org/r/20230802-ath11k-ack_status_leak-v2-1-c0af729d6229@narfation.org
+---
+ drivers/net/wireless/ath/ath11k/dp_tx.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
+@@ -369,7 +369,7 @@ ath11k_dp_tx_htt_tx_complete_buf(struct
+ "dp_tx: failed to find the peer with peer_id %d\n",
+ ts->peer_id);
+ spin_unlock_bh(&ab->base_lock);
+- dev_kfree_skb_any(msdu);
++ ieee80211_free_txskb(ar->hw, msdu);
+ return;
+ }
+ spin_unlock_bh(&ab->base_lock);
+@@ -624,7 +624,7 @@ static void ath11k_dp_tx_complete_msdu(s
+ "dp_tx: failed to find the peer with peer_id %d\n",
+ ts->peer_id);
+ spin_unlock_bh(&ab->base_lock);
+- dev_kfree_skb_any(msdu);
++ ieee80211_free_txskb(ar->hw, msdu);
+ return;
+ }
+ arsta = (struct ath11k_sta *)peer->sta->drv_priv;
--- /dev/null
+From 29d15589f084d71a4ea8c544039c5839db0236e2 Mon Sep 17 00:00:00 2001
+From: Sven Eckelmann <sven@narfation.org>
+Date: Tue, 22 Aug 2023 16:42:24 +0300
+Subject: [PATCH] wifi: ath11k: Cleanup mac80211 references on failure during
+ tx_complete
+
+When a function is using functions from mac80211 to free an skb then it
+should do it consistently and not switch to the generic dev_kfree_skb_any
+(or similar functions). Otherwise (like in the error handlers), mac80211
+will will not be aware of the freed skb and thus not clean up related
+information in its internal data structures.
+
+Not doing so lead in the past to filled up structure which then prevented
+new clients to connect.
+
+Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
+Fixes: 6257c702264c ("wifi: ath11k: fix tx status reporting in encap offload mode")
+Cc: stable@vger.kernel.org
+Signed-off-by: Sven Eckelmann <sven@narfation.org>
+Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
+Link: https://lore.kernel.org/r/20230802-ath11k-ack_status_leak-v2-2-c0af729d6229@narfation.org
+---
+ drivers/net/wireless/ath/ath11k/dp_tx.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
+@@ -344,7 +344,7 @@ ath11k_dp_tx_htt_tx_complete_buf(struct
+ dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
+
+ if (!skb_cb->vif) {
+- dev_kfree_skb_any(msdu);
++ ieee80211_free_txskb(ar->hw, msdu);
+ return;
+ }
+
+@@ -566,12 +566,12 @@ static void ath11k_dp_tx_complete_msdu(s
+ dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
+
+ if (unlikely(!rcu_access_pointer(ab->pdevs_active[ar->pdev_idx]))) {
+- dev_kfree_skb_any(msdu);
++ ieee80211_free_txskb(ar->hw, msdu);
+ return;
+ }
+
+ if (unlikely(!skb_cb->vif)) {
+- dev_kfree_skb_any(msdu);
++ ieee80211_free_txskb(ar->hw, msdu);
+ return;
+ }
+
--- /dev/null
+From 9476cda44c136089f14f8951ae5197d63e91735c Mon Sep 17 00:00:00 2001
+From: Jeff Johnson <quic_jjohnson@quicinc.com>
+Date: Mon, 21 Aug 2023 07:13:36 -0700
+Subject: [PATCH] wifi: ath11k: Consistently use ath11k_vif_to_arvif()
+
+Helper function ath11k_vif_to_arvif() exists to retrieve a struct
+ath11k_vif from a struct ieee80211_vif. However, in multiple places
+this logic is open-coded with inline typecasting. Since the
+typecasting prevents the compiler from type-checking the source and
+destination, update the driver to consistently use the helper
+function.
+
+No functional changes, compile tested only.
+
+Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
+Link: https://lore.kernel.org/r/20230821-ath11k_vif_to_arvif-v1-1-fa2c3b60b5cf@quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/mac.c | 64 +++++++++++-----------
+ drivers/net/wireless/ath/ath11k/testmode.c | 2 +-
+ 2 files changed, 33 insertions(+), 33 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/mac.c
++++ b/drivers/net/wireless/ath/ath11k/mac.c
+@@ -566,7 +566,7 @@ static void ath11k_get_arvif_iter(void *
+ struct ieee80211_vif *vif)
+ {
+ struct ath11k_vif_iter *arvif_iter = data;
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+
+ if (arvif->vdev_id == arvif_iter->vdev_id)
+ arvif_iter->arvif = arvif;
+@@ -1464,7 +1464,7 @@ static int ath11k_mac_setup_bcn_tmpl_ema
+ u32 params = 0;
+ u8 i = 0;
+
+- tx_arvif = (void *)arvif->vif->mbssid_tx_vif->drv_priv;
++ tx_arvif = ath11k_vif_to_arvif(arvif->vif->mbssid_tx_vif);
+
+ beacons = ieee80211_beacon_get_template_ema_list(tx_arvif->ar->hw,
+ tx_arvif->vif, 0);
+@@ -1520,8 +1520,8 @@ static int ath11k_mac_setup_bcn_tmpl_mbs
+ struct sk_buff *bcn;
+ int ret;
+
+- if (arvif->vif->mbssid_tx_vif) {
+- tx_arvif = (void *)arvif->vif->mbssid_tx_vif->drv_priv;
++ if (vif->mbssid_tx_vif) {
++ tx_arvif = ath11k_vif_to_arvif(vif->mbssid_tx_vif);
+ if (tx_arvif != arvif) {
+ ar = tx_arvif->ar;
+ ab = ar->ab;
+@@ -1562,7 +1562,7 @@ static int ath11k_mac_setup_bcn_tmpl(str
+ * non-transmitting interfaces, and results in a crash if sent.
+ */
+ if (vif->mbssid_tx_vif &&
+- arvif != (void *)vif->mbssid_tx_vif->drv_priv && arvif->is_up)
++ arvif != ath11k_vif_to_arvif(vif->mbssid_tx_vif) && arvif->is_up)
+ return 0;
+
+ if (vif->bss_conf.ema_ap && vif->mbssid_tx_vif)
+@@ -1626,7 +1626,7 @@ static void ath11k_control_beaconing(str
+ ether_addr_copy(arvif->bssid, info->bssid);
+
+ if (arvif->vif->mbssid_tx_vif)
+- tx_arvif = (struct ath11k_vif *)arvif->vif->mbssid_tx_vif->drv_priv;
++ tx_arvif = ath11k_vif_to_arvif(arvif->vif->mbssid_tx_vif);
+
+ ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid,
+ arvif->bssid,
+@@ -1649,7 +1649,7 @@ static void ath11k_mac_handle_beacon_ite
+ {
+ struct sk_buff *skb = data;
+ struct ieee80211_mgmt *mgmt = (void *)skb->data;
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+
+ if (vif->type != NL80211_IFTYPE_STATION)
+ return;
+@@ -1672,7 +1672,7 @@ static void ath11k_mac_handle_beacon_mis
+ struct ieee80211_vif *vif)
+ {
+ u32 *vdev_id = data;
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ struct ath11k *ar = arvif->ar;
+ struct ieee80211_hw *hw = ar->hw;
+
+@@ -1718,7 +1718,7 @@ static void ath11k_peer_assoc_h_basic(st
+ struct ieee80211_sta *sta,
+ struct peer_assoc_params *arg)
+ {
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ u32 aid;
+
+ lockdep_assert_held(&ar->conf_mutex);
+@@ -1746,7 +1746,7 @@ static void ath11k_peer_assoc_h_crypto(s
+ struct ieee80211_bss_conf *info = &vif->bss_conf;
+ struct cfg80211_chan_def def;
+ struct cfg80211_bss *bss;
+- struct ath11k_vif *arvif = (struct ath11k_vif *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ const u8 *rsnie = NULL;
+ const u8 *wpaie = NULL;
+
+@@ -1804,7 +1804,7 @@ static void ath11k_peer_assoc_h_rates(st
+ struct ieee80211_sta *sta,
+ struct peer_assoc_params *arg)
+ {
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ struct wmi_rate_set_arg *rateset = &arg->peer_legacy_rates;
+ struct cfg80211_chan_def def;
+ const struct ieee80211_supported_band *sband;
+@@ -1867,7 +1867,7 @@ static void ath11k_peer_assoc_h_ht(struc
+ struct peer_assoc_params *arg)
+ {
+ const struct ieee80211_sta_ht_cap *ht_cap = &sta->deflink.ht_cap;
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ struct cfg80211_chan_def def;
+ enum nl80211_band band;
+ const u8 *ht_mcs_mask;
+@@ -2064,7 +2064,7 @@ static void ath11k_peer_assoc_h_vht(stru
+ struct peer_assoc_params *arg)
+ {
+ const struct ieee80211_sta_vht_cap *vht_cap = &sta->deflink.vht_cap;
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ struct cfg80211_chan_def def;
+ enum nl80211_band band;
+ u16 *vht_mcs_mask;
+@@ -2261,7 +2261,7 @@ static void ath11k_peer_assoc_h_he(struc
+ struct ieee80211_sta *sta,
+ struct peer_assoc_params *arg)
+ {
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ struct cfg80211_chan_def def;
+ const struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap;
+ enum nl80211_band band;
+@@ -2584,7 +2584,7 @@ static void ath11k_peer_assoc_h_qos(stru
+ struct ieee80211_sta *sta,
+ struct peer_assoc_params *arg)
+ {
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+
+ switch (arvif->vdev_type) {
+ case WMI_VDEV_TYPE_AP:
+@@ -2747,7 +2747,7 @@ static void ath11k_peer_assoc_h_phymode(
+ struct ieee80211_sta *sta,
+ struct peer_assoc_params *arg)
+ {
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ struct cfg80211_chan_def def;
+ enum nl80211_band band;
+ const u8 *ht_mcs_mask;
+@@ -2933,7 +2933,7 @@ static bool ath11k_mac_vif_recalc_sta_he
+ struct ieee80211_vif *vif,
+ struct ieee80211_sta_he_cap *he_cap)
+ {
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ struct ieee80211_he_cap_elem he_cap_elem = {0};
+ struct ieee80211_sta_he_cap *cap_band = NULL;
+ struct cfg80211_chan_def def;
+@@ -2995,7 +2995,7 @@ static void ath11k_bss_assoc(struct ieee
+ struct ieee80211_bss_conf *bss_conf)
+ {
+ struct ath11k *ar = hw->priv;
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ struct peer_assoc_params peer_arg;
+ struct ieee80211_sta *ap_sta;
+ struct ath11k_peer *peer;
+@@ -3111,7 +3111,7 @@ static void ath11k_bss_disassoc(struct i
+ struct ieee80211_vif *vif)
+ {
+ struct ath11k *ar = hw->priv;
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ int ret;
+
+ lockdep_assert_held(&ar->conf_mutex);
+@@ -3160,7 +3160,7 @@ static void ath11k_recalculate_mgmt_rate
+ struct ieee80211_vif *vif,
+ struct cfg80211_chan_def *def)
+ {
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ const struct ieee80211_supported_band *sband;
+ u8 basic_rate_idx;
+ int hw_rate_code;
+@@ -4632,7 +4632,7 @@ static int ath11k_station_disassoc(struc
+ struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta)
+ {
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ int ret = 0;
+
+ lockdep_assert_held(&ar->conf_mutex);
+@@ -5160,7 +5160,7 @@ static int ath11k_mac_op_sta_set_txpwr(s
+ struct ieee80211_sta *sta)
+ {
+ struct ath11k *ar = hw->priv;
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ int ret = 0;
+ s16 txpwr;
+
+@@ -5210,7 +5210,7 @@ static void ath11k_mac_op_sta_rc_update(
+ {
+ struct ath11k *ar = hw->priv;
+ struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv;
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ struct ath11k_peer *peer;
+ u32 bw, smps;
+
+@@ -5337,7 +5337,7 @@ static int ath11k_mac_op_conf_tx(struct
+ const struct ieee80211_tx_queue_params *params)
+ {
+ struct ath11k *ar = hw->priv;
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ struct wmi_wmm_params_arg *p = NULL;
+ int ret;
+
+@@ -6455,7 +6455,7 @@ static int ath11k_mac_setup_vdev_params_
+ return 0;
+ }
+
+- tx_arvif = (void *)tx_vif->drv_priv;
++ tx_arvif = ath11k_vif_to_arvif(tx_vif);
+
+ if (arvif->vif->bss_conf.nontransmitted) {
+ if (ar->hw->wiphy != ieee80211_vif_to_wdev(tx_vif)->wiphy)
+@@ -7408,7 +7408,7 @@ ath11k_mac_update_vif_chan(struct ath11k
+ /* TODO: Update ar->rx_channel */
+
+ for (i = 0; i < n_vifs; i++) {
+- arvif = (void *)vifs[i].vif->drv_priv;
++ arvif = ath11k_vif_to_arvif(vifs[i].vif);
+
+ if (WARN_ON(!arvif->is_started))
+ continue;
+@@ -7450,7 +7450,7 @@ ath11k_mac_update_vif_chan(struct ath11k
+
+ mbssid_tx_vif = arvif->vif->mbssid_tx_vif;
+ if (mbssid_tx_vif)
+- tx_arvif = (struct ath11k_vif *)mbssid_tx_vif->drv_priv;
++ tx_arvif = ath11k_vif_to_arvif(mbssid_tx_vif);
+
+ ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid,
+ arvif->bssid,
+@@ -7546,7 +7546,7 @@ static int ath11k_start_vdev_delay(struc
+ {
+ struct ath11k *ar = hw->priv;
+ struct ath11k_base *ab = ar->ab;
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ int ret;
+
+ if (WARN_ON(arvif->is_started))
+@@ -7596,7 +7596,7 @@ ath11k_mac_op_assign_vif_chanctx(struct
+ {
+ struct ath11k *ar = hw->priv;
+ struct ath11k_base *ab = ar->ab;
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ int ret;
+ struct peer_create_params param;
+
+@@ -7686,7 +7686,7 @@ ath11k_mac_op_unassign_vif_chanctx(struc
+ {
+ struct ath11k *ar = hw->priv;
+ struct ath11k_base *ab = ar->ab;
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ struct ath11k_peer *peer;
+ int ret;
+
+@@ -8307,7 +8307,7 @@ ath11k_mac_op_set_bitrate_mask(struct ie
+ struct ieee80211_vif *vif,
+ const struct cfg80211_bitrate_mask *mask)
+ {
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ struct cfg80211_chan_def def;
+ struct ath11k_pdev_cap *cap;
+ struct ath11k *ar = arvif->ar;
+@@ -8904,7 +8904,7 @@ static int ath11k_mac_op_remain_on_chann
+ enum ieee80211_roc_type type)
+ {
+ struct ath11k *ar = hw->priv;
+- struct ath11k_vif *arvif = (void *)vif->drv_priv;
++ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
+ struct scan_req_params arg;
+ int ret;
+ u32 scan_time_msec;
+--- a/drivers/net/wireless/ath/ath11k/testmode.c
++++ b/drivers/net/wireless/ath/ath11k/testmode.c
+@@ -350,7 +350,7 @@ static int ath11k_tm_cmd_wmi(struct ath1
+ if (ar->ab->fw_mode != ATH11K_FIRMWARE_MODE_FTM &&
+ (tag == WMI_TAG_VDEV_SET_PARAM_CMD || tag == WMI_TAG_UNIT_TEST_CMD)) {
+ if (vif) {
+- arvif = (struct ath11k_vif *)vif->drv_priv;
++ arvif = ath11k_vif_to_arvif(vif);
+ *ptr = arvif->vdev_id;
+ } else {
+ ret = -EINVAL;
--- /dev/null
+From d68a283bfc39aeed2a51c67804e014bf4b35c7e1 Mon Sep 17 00:00:00 2001
+From: Jeff Johnson <quic_jjohnson@quicinc.com>
+Date: Tue, 22 Aug 2023 07:50:49 -0700
+Subject: [PATCH] wifi: ath11k: Fix a few spelling errors
+
+Fix a few issues flagged by 'codespell'.
+
+Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
+Acked-by: Randy Dunlap <rdunlap@infradead.org>
+Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
+Link: https://lore.kernel.org/r/20230822-ath_spelling-v1-2-8e2698759564@quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/dp.h | 2 +-
+ drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +-
+ drivers/net/wireless/ath/ath11k/dp_tx.c | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/dp.h
++++ b/drivers/net/wireless/ath/ath11k/dp.h
+@@ -635,7 +635,7 @@ enum htt_ppdu_stats_tag_type {
+ * b'24 - status_swap: 1 is to swap status TLV
+ * b'25 - pkt_swap: 1 is to swap packet TLV
+ * b'26:31 - rsvd1: reserved for future use
+- * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
++ * dword1 - b'0:16 - ring_buffer_size: size of buffers referenced by rx ring,
+ * in byte units.
+ * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
+ * - b'16:31 - rsvd2: Reserved for future use
+--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
+@@ -3423,7 +3423,7 @@ static int ath11k_dp_rx_h_defrag_reo_rei
+ ath11k_hal_rx_buf_addr_info_set(msdu0, paddr, cookie,
+ ab->hw_params.hal_params->rx_buf_rbm);
+
+- /* Fill mpdu details into reo entrace ring */
++ /* Fill mpdu details into reo entrance ring */
+ srng = &ab->hal.srng_list[ab->dp.reo_reinject_ring.ring_id];
+
+ spin_lock_bh(&srng->lock);
+--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
++++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
+@@ -238,7 +238,7 @@ tcl_ring_sel:
+ spin_unlock_bh(&tcl_ring->lock);
+ ret = -ENOMEM;
+
+- /* Checking for available tcl descritors in another ring in
++ /* Checking for available tcl descriptors in another ring in
+ * case of failure due to full tcl ring now, is better than
+ * checking this ring earlier for each pkt tx.
+ * Restart ring selection if some rings are not checked yet.
--- /dev/null
+From 749a660b39030bfbacc366cd8670df2ee0e878b2 Mon Sep 17 00:00:00 2001
+From: Yang Yingliang <yangyingliang@huawei.com>
+Date: Fri, 4 Aug 2023 17:12:55 +0800
+Subject: [PATCH] wifi: ath11k: simplify the code with module_platform_driver
+
+The init/exit() of driver only calls platform_driver_register/unregister,
+it can be simpilfied with module_platform_driver.
+
+Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
+Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
+Link: https://lore.kernel.org/r/20230804091255.1347178-1-yangyingliang@huawei.com
+---
+ drivers/net/wireless/ath/ath11k/ahb.c | 12 +-----------
+ 1 file changed, 1 insertion(+), 11 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/ahb.c
++++ b/drivers/net/wireless/ath/ath11k/ahb.c
+@@ -1306,17 +1306,7 @@ static struct platform_driver ath11k_ahb
+ .shutdown = ath11k_ahb_shutdown,
+ };
+
+-static int ath11k_ahb_init(void)
+-{
+- return platform_driver_register(&ath11k_ahb_driver);
+-}
+-module_init(ath11k_ahb_init);
+-
+-static void ath11k_ahb_exit(void)
+-{
+- platform_driver_unregister(&ath11k_ahb_driver);
+-}
+-module_exit(ath11k_ahb_exit);
++module_platform_driver(ath11k_ahb_driver);
+
+ MODULE_DESCRIPTION("Driver support for Qualcomm Technologies 802.11ax WLAN AHB devices");
+ MODULE_LICENSE("Dual BSD/GPL");
--- /dev/null
+From 6763ef191d672ff3c2db0622652d49b0c0a60c4a Mon Sep 17 00:00:00 2001
+From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+Date: Thu, 10 Aug 2023 11:12:23 +0200
+Subject: [PATCH] wifi: ath11k: fix Wvoid-pointer-to-enum-cast warning
+
+'hw_rev' is an enum, thus cast of pointer on 64-bit compile test with W=1
+causes:
+
+ h11k/ahb.c:1124:11: error: cast to smaller integer type 'enum ath11k_hw_rev' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
+
+Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
+Link: https://lore.kernel.org/r/20230810091224.70088-1-krzysztof.kozlowski@linaro.org
+---
+ drivers/net/wireless/ath/ath11k/ahb.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/ath/ath11k/ahb.c
++++ b/drivers/net/wireless/ath/ath11k/ahb.c
+@@ -1096,7 +1096,7 @@ static int ath11k_ahb_probe(struct platf
+ return -EINVAL;
+ }
+
+- hw_rev = (enum ath11k_hw_rev)of_id->data;
++ hw_rev = (uintptr_t)of_id->data;
+
+ switch (hw_rev) {
+ case ATH11K_HW_IPQ8074:
--- /dev/null
+From adb0b206709f4f2f1256a1ea20619ab98e99f2e7 Mon Sep 17 00:00:00 2001
+From: Yue Haibing <yuehaibing@huawei.com>
+Date: Fri, 11 Aug 2023 18:44:13 +0800
+Subject: [PATCH] wifi: ath11k: Remove unused declarations
+
+Commit 2c3960c2253d ("ath11k: setup ce tasklet for control path")
+declared but never implemented ath11k_ce_map_service_to_pipe().
+Commit e3396b8bddd2 ("ath11k: ce: support different CE configurations")
+declared but never implemented ath11k_ce_attr_attach().
+Commit d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
+declared but never implemented ath11k_qmi_event_work()/ath11k_qmi_msg_recv_work().
+
+Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
+Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
+Link: https://lore.kernel.org/r/20230811104413.33668-1-yuehaibing@huawei.com
+---
+ drivers/net/wireless/ath/ath11k/ce.h | 3 ---
+ drivers/net/wireless/ath/ath11k/qmi.h | 2 --
+ 2 files changed, 5 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/ce.h
++++ b/drivers/net/wireless/ath/ath11k/ce.h
+@@ -203,9 +203,6 @@ int ath11k_ce_alloc_pipes(struct ath11k_
+ void ath11k_ce_free_pipes(struct ath11k_base *ab);
+ int ath11k_ce_get_attr_flags(struct ath11k_base *ab, int ce_id);
+ void ath11k_ce_poll_send_completed(struct ath11k_base *ab, u8 pipe_id);
+-int ath11k_ce_map_service_to_pipe(struct ath11k_base *ab, u16 service_id,
+- u8 *ul_pipe, u8 *dl_pipe);
+-int ath11k_ce_attr_attach(struct ath11k_base *ab);
+ void ath11k_ce_get_shadow_config(struct ath11k_base *ab,
+ u32 **shadow_cfg, u32 *shadow_cfg_len);
+ void ath11k_ce_stop_shadow_timers(struct ath11k_base *ab);
+--- a/drivers/net/wireless/ath/ath11k/qmi.h
++++ b/drivers/net/wireless/ath/ath11k/qmi.h
+@@ -514,8 +514,6 @@ struct qmi_wlanfw_wlan_ini_resp_msg_v01
+ int ath11k_qmi_firmware_start(struct ath11k_base *ab,
+ u32 mode);
+ void ath11k_qmi_firmware_stop(struct ath11k_base *ab);
+-void ath11k_qmi_event_work(struct work_struct *work);
+-void ath11k_qmi_msg_recv_work(struct work_struct *work);
+ void ath11k_qmi_deinit_service(struct ath11k_base *ab);
+ int ath11k_qmi_init_service(struct ath11k_base *ab);
+ void ath11k_qmi_free_resource(struct ath11k_base *ab);
--- /dev/null
+From 4a93b554cf9fa64faa7cf164c0d32fc3ce67108b Mon Sep 17 00:00:00 2001
+From: Arowa Suliman <arowa@chromium.org>
+Date: Sat, 26 Aug 2023 08:42:42 +0300
+Subject: [PATCH] wifi: ath11k: mhi: add a warning message for MHI_CB_EE_RDDM
+ crash
+
+Currently, the ath11k driver does not print a crash signature when a
+MHI_CB_EE_RDDM crash happens. Checked by triggering a simulated crash using the
+command and checking dmesg for logs:
+
+echo assert > /sys/kernel/debug/ath11k/../simulate_fw_crash
+
+Add a warning when firmware crash MHI_CB_EE_RDDM happens.
+
+Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
+
+Signed-off-by: Arowa Suliman <arowa@chromium.org>
+Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
+Link: https://lore.kernel.org/r/20230714001126.463127-1-arowa@chromium.org
+---
+ drivers/net/wireless/ath/ath11k/mhi.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/wireless/ath/ath11k/mhi.c
++++ b/drivers/net/wireless/ath/ath11k/mhi.c
+@@ -333,6 +333,7 @@ static void ath11k_mhi_op_status_cb(stru
+ ath11k_warn(ab, "firmware crashed: MHI_CB_SYS_ERROR\n");
+ break;
+ case MHI_CB_EE_RDDM:
++ ath11k_warn(ab, "firmware crashed: MHI_CB_EE_RDDM\n");
+ if (!(test_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags)))
+ queue_work(ab->workqueue_aux, &ab->reset_work);
+ break;
--- /dev/null
+From 5bd2ced044bb95029d5c44cf7d23ced73e0fc05b Mon Sep 17 00:00:00 2001
+From: Muna Sinada <quic_msinada@quicinc.com>
+Date: Sat, 26 Aug 2023 08:42:46 +0300
+Subject: [PATCH] wifi: ath11k: move references from rsvd2 to info fields
+
+Remove references to reserved fields and add new info fields for
+struct hal_rx_ppdu_end_user_stats. Reserved fields should not be
+accessed, therefore existing references to it are to be changed to
+referencing specific info fields.
+
+Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1
+
+Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
+Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
+Link: https://lore.kernel.org/r/1692827868-15667-1-git-send-email-quic_msinada@quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/hal_rx.c | 10 +++++-----
+ drivers/net/wireless/ath/ath11k/hal_rx.h | 11 ++++++++---
+ 2 files changed, 13 insertions(+), 8 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/hal_rx.c
++++ b/drivers/net/wireless/ath/ath11k/hal_rx.c
+@@ -814,7 +814,7 @@ ath11k_hal_rx_handle_ofdma_info(void *rx
+
+ rx_user_status->ul_ofdma_user_v0_word0 = __le32_to_cpu(ppdu_end_user->info6);
+
+- rx_user_status->ul_ofdma_user_v0_word1 = __le32_to_cpu(ppdu_end_user->rsvd2[10]);
++ rx_user_status->ul_ofdma_user_v0_word1 = __le32_to_cpu(ppdu_end_user->info9);
+ }
+
+ static inline void
+@@ -825,11 +825,11 @@ ath11k_hal_rx_populate_byte_count(void *
+ (struct hal_rx_ppdu_end_user_stats *)rx_tlv;
+
+ rx_user_status->mpdu_ok_byte_count =
+- FIELD_GET(HAL_RX_PPDU_END_USER_STATS_RSVD2_6_MPDU_OK_BYTE_COUNT,
+- __le32_to_cpu(ppdu_end_user->rsvd2[6]));
++ FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_OK_BYTE_COUNT,
++ __le32_to_cpu(ppdu_end_user->info7));
+ rx_user_status->mpdu_err_byte_count =
+- FIELD_GET(HAL_RX_PPDU_END_USER_STATS_RSVD2_8_MPDU_ERR_BYTE_COUNT,
+- __le32_to_cpu(ppdu_end_user->rsvd2[8]));
++ FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO9_MPDU_ERR_BYTE_COUNT,
++ __le32_to_cpu(ppdu_end_user->info8));
+ }
+
+ static inline void
+--- a/drivers/net/wireless/ath/ath11k/hal_rx.h
++++ b/drivers/net/wireless/ath/ath11k/hal_rx.h
+@@ -222,8 +222,8 @@ struct hal_rx_ppdu_start {
+ #define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP GENMASK(15, 0)
+ #define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_EOSP_BITMAP GENMASK(31, 16)
+
+-#define HAL_RX_PPDU_END_USER_STATS_RSVD2_6_MPDU_OK_BYTE_COUNT GENMASK(24, 0)
+-#define HAL_RX_PPDU_END_USER_STATS_RSVD2_8_MPDU_ERR_BYTE_COUNT GENMASK(24, 0)
++#define HAL_RX_PPDU_END_USER_STATS_INFO7_MPDU_OK_BYTE_COUNT GENMASK(24, 0)
++#define HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_ERR_BYTE_COUNT GENMASK(24, 0)
+
+ struct hal_rx_ppdu_end_user_stats {
+ __le32 rsvd0[2];
+@@ -236,7 +236,12 @@ struct hal_rx_ppdu_end_user_stats {
+ __le32 info4;
+ __le32 info5;
+ __le32 info6;
+- __le32 rsvd2[11];
++ __le32 rsvd2[5];
++ __le32 info7;
++ __le32 rsvd3;
++ __le32 info8;
++ __le32 rsvd3[2];
++ __le32 info9;
+ } __packed;
+
+ struct hal_rx_ppdu_end_user_stats_ext {
--- /dev/null
+From 7791487cd16cafd018cba0bf73789111a9f16843 Mon Sep 17 00:00:00 2001
+From: Muna Sinada <quic_msinada@quicinc.com>
+Date: Sat, 26 Aug 2023 08:42:46 +0300
+Subject: [PATCH] wifi: ath11k: fix tid bitmap is 0 in peer rx mu stats
+
+Correct parsing of reading offset for rx tid 16 bit bitmap. Incorrect
+offset caused peer rx mu stats tid bitmap to always be zero. This
+correction is in the software context and does not affect the
+firmware interface.
+
+Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1
+
+Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
+Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
+Link: https://lore.kernel.org/r/1692827868-15667-2-git-send-email-quic_msinada@quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/hal_rx.c | 10 +++++-----
+ drivers/net/wireless/ath/ath11k/hal_rx.h | 17 +++++++++--------
+ 2 files changed, 14 insertions(+), 13 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/hal_rx.c
++++ b/drivers/net/wireless/ath/ath11k/hal_rx.c
+@@ -814,7 +814,7 @@ ath11k_hal_rx_handle_ofdma_info(void *rx
+
+ rx_user_status->ul_ofdma_user_v0_word0 = __le32_to_cpu(ppdu_end_user->info6);
+
+- rx_user_status->ul_ofdma_user_v0_word1 = __le32_to_cpu(ppdu_end_user->info9);
++ rx_user_status->ul_ofdma_user_v0_word1 = __le32_to_cpu(ppdu_end_user->info10);
+ }
+
+ static inline void
+@@ -826,10 +826,10 @@ ath11k_hal_rx_populate_byte_count(void *
+
+ rx_user_status->mpdu_ok_byte_count =
+ FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_OK_BYTE_COUNT,
+- __le32_to_cpu(ppdu_end_user->info7));
++ __le32_to_cpu(ppdu_end_user->info8));
+ rx_user_status->mpdu_err_byte_count =
+ FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO9_MPDU_ERR_BYTE_COUNT,
+- __le32_to_cpu(ppdu_end_user->info8));
++ __le32_to_cpu(ppdu_end_user->info9));
+ }
+
+ static inline void
+@@ -903,8 +903,8 @@ ath11k_hal_rx_parse_mon_status_tlv(struc
+ FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO2_AST_INDEX,
+ __le32_to_cpu(eu_stats->info2));
+ ppdu_info->tid =
+- ffs(FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP,
+- __le32_to_cpu(eu_stats->info6))) - 1;
++ ffs(FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO7_TID_BITMAP,
++ __le32_to_cpu(eu_stats->info7))) - 1;
+ ppdu_info->tcp_msdu_count =
+ FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO4_TCP_MSDU_CNT,
+ __le32_to_cpu(eu_stats->info4));
+--- a/drivers/net/wireless/ath/ath11k/hal_rx.h
++++ b/drivers/net/wireless/ath/ath11k/hal_rx.h
+@@ -149,7 +149,7 @@ struct hal_rx_mon_ppdu_info {
+ u8 beamformed;
+ u8 rssi_comb;
+ u8 rssi_chain_pri20[HAL_RX_MAX_NSS];
+- u8 tid;
++ u16 tid;
+ u16 ht_flags;
+ u16 vht_flags;
+ u16 he_flags;
+@@ -219,11 +219,11 @@ struct hal_rx_ppdu_start {
+ #define HAL_RX_PPDU_END_USER_STATS_INFO5_OTHER_MSDU_CNT GENMASK(15, 0)
+ #define HAL_RX_PPDU_END_USER_STATS_INFO5_TCP_ACK_MSDU_CNT GENMASK(31, 16)
+
+-#define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_BITMAP GENMASK(15, 0)
+-#define HAL_RX_PPDU_END_USER_STATS_INFO6_TID_EOSP_BITMAP GENMASK(31, 16)
++#define HAL_RX_PPDU_END_USER_STATS_INFO7_TID_BITMAP GENMASK(15, 0)
++#define HAL_RX_PPDU_END_USER_STATS_INFO7_TID_EOSP_BITMAP GENMASK(31, 16)
+
+-#define HAL_RX_PPDU_END_USER_STATS_INFO7_MPDU_OK_BYTE_COUNT GENMASK(24, 0)
+-#define HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_ERR_BYTE_COUNT GENMASK(24, 0)
++#define HAL_RX_PPDU_END_USER_STATS_INFO8_MPDU_OK_BYTE_COUNT GENMASK(24, 0)
++#define HAL_RX_PPDU_END_USER_STATS_INFO9_MPDU_ERR_BYTE_COUNT GENMASK(24, 0)
+
+ struct hal_rx_ppdu_end_user_stats {
+ __le32 rsvd0[2];
+@@ -236,12 +236,13 @@ struct hal_rx_ppdu_end_user_stats {
+ __le32 info4;
+ __le32 info5;
+ __le32 info6;
+- __le32 rsvd2[5];
+ __le32 info7;
+- __le32 rsvd3;
++ __le32 rsvd2[4];
+ __le32 info8;
+- __le32 rsvd3[2];
++ __le32 rsvd3;
+ __le32 info9;
++ __le32 rsvd4[2];
++ __le32 info10;
+ } __packed;
+
+ struct hal_rx_ppdu_end_user_stats_ext {
default:
return "UNKNOWN";
}
-@@ -336,27 +366,14 @@ static void ath11k_mhi_op_status_cb(stru
+@@ -337,27 +367,14 @@ static void ath11k_mhi_op_status_cb(stru
if (!(test_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags)))
queue_work(ab->workqueue_aux, &ab->reset_work);
break;
int ath11k_mhi_register(struct ath11k_pci *ar_pci);
--- a/drivers/net/wireless/ath/ath11k/pci.c
+++ b/drivers/net/wireless/ath/ath11k/pci.c
-@@ -370,13 +370,20 @@ static void ath11k_pci_sw_reset(struct a
+@@ -371,13 +371,20 @@ static void ath11k_pci_sw_reset(struct a
static void ath11k_pci_init_qmi_ce_config(struct ath11k_base *ab)
{
struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg;
--- a/drivers/net/wireless/ath/ath11k/pci.c
+++ b/drivers/net/wireless/ath/ath11k/pci.c
-@@ -458,7 +458,11 @@ static int ath11k_pci_alloc_msi(struct a
+@@ -459,7 +459,11 @@ static int ath11k_pci_alloc_msi(struct a
pci_read_config_dword(pci_dev, pci_dev->msi_cap + PCI_MSI_ADDRESS_LO,
&ab->pci.msi.addr_lo);
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
- drivers/net/wireless/ath/ath11k/core.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ drivers/net/wireless/ath/ath11k/core.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
-@@ -86,7 +86,7 @@ static const struct ath11k_hw_params ath
+@@ -86,8 +86,8 @@ static const struct ath11k_hw_params ath
.supports_shadow_regs = false,
.idle_ps = false,
.supports_sta_ps = false,
-- .cold_boot_calib = true,
-+ .cold_boot_calib = false,
+- .coldboot_cal_mm = true,
+- .coldboot_cal_ftm = true,
++ .coldboot_cal_mm = false,
++ .coldboot_cal_ftm = false,
.cbcal_restart_fw = true,
.fw_mem_mode = 0,
.num_vdevs = 16 + 1,
{
.hw_rev = ATH11K_HW_IPQ8074,
.name = "ipq8074 hw2.0",
-@@ -1954,7 +1954,8 @@ static void ath11k_core_reset(struct wor
+@@ -1974,7 +1974,8 @@ static void ath11k_core_reset(struct wor
static int ath11k_init_hw_params(struct ath11k_base *ab)
{
const struct ath11k_hw_params *hw_params = NULL;
for (i = 0; i < ARRAY_SIZE(ath11k_hw_params); i++) {
hw_params = &ath11k_hw_params[i];
-@@ -1970,7 +1971,30 @@ static int ath11k_init_hw_params(struct
+@@ -1990,7 +1991,31 @@ static int ath11k_init_hw_params(struct
ab->hw_params = *hw_params;
+ ab->hw_params.fw_mem_mode = 2;
+ ab->hw_params.num_vdevs = 8;
+ ab->hw_params.num_peers = 128;
-+ ab->hw_params.cold_boot_calib = false;
++ ab->hw_params.coldboot_cal_mm = false;
++ ab->hw_params.coldboot_cal_ftm = false;
+ } else
+ ath11k_info(ab, "Unsupported FW memory mode: %u\n", fw_mem_mode);
+ }