wil6210: abort properly in cfg suspend
authorHamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Tue, 14 Nov 2017 13:25:36 +0000 (15:25 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Sat, 2 Dec 2017 14:18:22 +0000 (16:18 +0200)
On-going operations were not aborted properly
and required locks were not taken.

Signed-off-by: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/wil6210/cfg80211.c

index 85d5c04618ebcafb87f8a089f31dac3b393f0dc5..c3d3c0c0e206a21a9f3c959a8e8940120a9ac5a3 100644 (file)
@@ -1727,9 +1727,12 @@ static int wil_cfg80211_suspend(struct wiphy *wiphy,
 
        wil_dbg_pm(wil, "suspending\n");
 
-       wil_p2p_stop_discovery(wil);
-
+       mutex_lock(&wil->mutex);
+       mutex_lock(&wil->p2p_wdev_mutex);
+       wil_p2p_stop_radio_operations(wil);
        wil_abort_scan(wil, true);
+       mutex_unlock(&wil->p2p_wdev_mutex);
+       mutex_unlock(&wil->mutex);
 
 out:
        return rc;