From caae98575efd4aa996a9f3324b2ebd98fb34bc53 Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: May 10 2023 08:44:24 +0000 Subject: wcn36xx: Ensure finish scan is not requested before start scan (git-fixes). --- diff --git a/patches.suse/wcn36xx-Ensure-finish-scan-is-not-requested-before-s.patch b/patches.suse/wcn36xx-Ensure-finish-scan-is-not-requested-before-s.patch new file mode 100644 index 0000000..4b257ba --- /dev/null +++ b/patches.suse/wcn36xx-Ensure-finish-scan-is-not-requested-before-s.patch @@ -0,0 +1,78 @@ +From d195d7aac09bddabc2c8326fb02fcec2b0a2de02 Mon Sep 17 00:00:00 2001 +From: Joseph Gates +Date: Wed, 18 Aug 2021 13:31:43 +0200 +Subject: [PATCH] wcn36xx: Ensure finish scan is not requested before start + scan +Git-commit: d195d7aac09bddabc2c8326fb02fcec2b0a2de02 +References: git-fixes +Patch-mainline: v5.15-rc1 + +If the operating channel is the first in the scan list, it was seen that +a finish scan request would be sent before a start scan request was +sent, causing the firmware to fail all future scans. Track the current +channel being scanned to avoid requesting the scan finish before it +starts. + +Cc: +Fixes: 5973a2947430 ("wcn36xx: Fix software-driven scan") +Signed-off-by: Joseph Gates +Signed-off-by: Loic Poulain +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/1629286303-13179-1-git-send-email-loic.poulain@linaro.org +Signed-off-by: Oliver Neukum +--- + drivers/net/wireless/ath/wcn36xx/main.c | 5 ++++- + drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 + + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c +index d202f2128df2..67f4db662402 100644 +--- a/drivers/net/wireless/ath/wcn36xx/main.c ++++ b/drivers/net/wireless/ath/wcn36xx/main.c +@@ -408,13 +408,14 @@ static int wcn36xx_config(struct ieee80211_hw *hw, u32 changed) + wcn36xx_dbg(WCN36XX_DBG_MAC, "wcn36xx_config channel switch=%d\n", + ch); + +- if (wcn->sw_scan_opchannel == ch) { ++ if (wcn->sw_scan_opchannel == ch && wcn->sw_scan_channel) { + /* If channel is the initial operating channel, we may + * want to receive/transmit regular data packets, then + * simply stop the scan session and exit PS mode. + */ + wcn36xx_smd_finish_scan(wcn, HAL_SYS_MODE_SCAN, + wcn->sw_scan_vif); ++ wcn->sw_scan_channel = 0; + } else if (wcn->sw_scan) { + /* A scan is ongoing, do not change the operating + * channel, but start a scan session on the channel. +@@ -422,6 +423,7 @@ static int wcn36xx_config(struct ieee80211_hw *hw, u32 changed) + wcn36xx_smd_init_scan(wcn, HAL_SYS_MODE_SCAN, + wcn->sw_scan_vif); + wcn36xx_smd_start_scan(wcn, ch); ++ wcn->sw_scan_channel = ch; + } else { + wcn36xx_change_opchannel(wcn, ch); + } +@@ -702,6 +704,7 @@ static void wcn36xx_sw_scan_start(struct ieee80211_hw *hw, + + wcn->sw_scan = true; + wcn->sw_scan_vif = vif; ++ wcn->sw_scan_channel = 0; + if (vif_priv->sta_assoc) + wcn->sw_scan_opchannel = WCN36XX_HW_CHANNEL(wcn); + else +diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +index 6121d8a5641a..0feb235b5a42 100644 +--- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h ++++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h +@@ -246,6 +246,7 @@ struct wcn36xx { + struct cfg80211_scan_request *scan_req; + bool sw_scan; + u8 sw_scan_opchannel; ++ u8 sw_scan_channel; + struct ieee80211_vif *sw_scan_vif; + struct mutex scan_lock; + bool scan_aborted; +-- +2.40.1 + diff --git a/series.conf b/series.conf index 4a36b5c..687552f 100644 --- a/series.conf +++ b/series.conf @@ -61439,6 +61439,7 @@ patches.suse/msft-hv-2430-net-mana-Move-NAPI-from-EQ-to-CQ.patch patches.suse/msft-hv-2431-net-mana-Add-support-for-EQ-sharing.patch patches.suse/msft-hv-2432-net-mana-Add-WARN_ON_ONCE-in-case-of-CQE-read-overfl.patch + patches.suse/wcn36xx-Ensure-finish-scan-is-not-requested-before-s.patch patches.suse/ath6kl-wmi-fix-an-error-code-in-ath6kl_wmi_sync_poin.patch patches.suse/bcma-Fix-memory-leak-for-internally-handled-cores.patch patches.suse/ipv4-make-exception-cache-less-predictible.patch