linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wcn36xx: Fix warning due to duplicate scan_completed notification
@ 2018-02-15 11:08 Loic Poulain
  2018-02-27 16:49 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Loic Poulain @ 2018-02-15 11:08 UTC (permalink / raw)
  To: kvalo, k.eugene.e
  Cc: linux-wireless, linux-arm-msm, bjorn.andersson, nicolas.dechesne,
	wcn36xx, Loic Poulain

The wcn36xx_cancel_hw_scan method stops the hw scan and notify the
scan completion via ieee80211_scan_completed.
However, on scan offload cancellation, firmware sends a scan complete
indication, triggering a new call to ieee80211_scan_completed.
This leads to kernel warn since the scan has already been completed.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/main.c | 9 +++------
 drivers/net/wireless/ath/wcn36xx/smd.c  | 2 ++
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index ab5be6d..fcc98d4 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -666,16 +666,13 @@ static void wcn36xx_cancel_hw_scan(struct ieee80211_hw *hw,
 {
 	struct wcn36xx *wcn = hw->priv;
 
-	if (!wcn36xx_smd_stop_hw_scan(wcn)) {
-		struct cfg80211_scan_info scan_info = { .aborted = true };
-
-		ieee80211_scan_completed(wcn->hw, &scan_info);
-	}
-
 	mutex_lock(&wcn->scan_lock);
 	wcn->scan_aborted = true;
 	mutex_unlock(&wcn->scan_lock);
 
+	/* ieee80211_scan_completed will be called on FW scan indication */
+	wcn36xx_smd_stop_hw_scan(wcn);
+
 	cancel_work_sync(&wcn->scan_work);
 }
 
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 2a4871c..7cc2928 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -2138,6 +2138,8 @@ static int wcn36xx_smd_hw_scan_ind(struct wcn36xx *wcn, void *buf, size_t len)
 	case WCN36XX_HAL_SCAN_IND_COMPLETED:
 		mutex_lock(&wcn->scan_lock);
 		wcn->scan_req = NULL;
+		if (wcn->scan_aborted)
+			scan_info.aborted = true;
 		mutex_unlock(&wcn->scan_lock);
 		ieee80211_scan_completed(wcn->hw, &scan_info);
 		break;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: wcn36xx: Fix warning due to duplicate scan_completed notification
  2018-02-15 11:08 [PATCH] wcn36xx: Fix warning due to duplicate scan_completed notification Loic Poulain
@ 2018-02-27 16:49 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2018-02-27 16:49 UTC (permalink / raw)
  To: Loic Poulain
  Cc: k.eugene.e, linux-wireless, linux-arm-msm, bjorn.andersson,
	nicolas.dechesne, wcn36xx, Loic Poulain

Loic Poulain <loic.poulain@linaro.org> wrote:

> The wcn36xx_cancel_hw_scan method stops the hw scan and notify the
> scan completion via ieee80211_scan_completed.
> However, on scan offload cancellation, firmware sends a scan complete
> indication, triggering a new call to ieee80211_scan_completed.
> This leads to kernel warn since the scan has already been completed.
> 
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

9bfd05e35ac3 wcn36xx: Fix warning due to duplicate scan_completed notification

-- 
https://patchwork.kernel.org/patch/10220895/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-27 16:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-15 11:08 [PATCH] wcn36xx: Fix warning due to duplicate scan_completed notification Loic Poulain
2018-02-27 16:49 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).