wil6210: fix sequence for scan-abort during reset
authorHamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Wed, 5 Apr 2017 11:58:04 +0000 (14:58 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 13 Apr 2017 12:45:39 +0000 (15:45 +0300)
Communication with FW must be done before wil->status
is initialized in order to properly handle cases where
communication with FW halts during reset sequence.

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/main.c

index c33cc4ad44c4487ecee81d294bbf206e5bdf6d36..7e72096d738a9a54d1197efa5ad057b51f0fee5a 100644 (file)
@@ -948,15 +948,15 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
        /* Disable device led before reset*/
        wmi_led_cfg(wil, false);
 
+       mutex_lock(&wil->p2p_wdev_mutex);
+       wil_abort_scan(wil, false);
+       mutex_unlock(&wil->p2p_wdev_mutex);
+
        /* prevent NAPI from being scheduled and prevent wmi commands */
        mutex_lock(&wil->wmi_mutex);
        bitmap_zero(wil->status, wil_status_last);
        mutex_unlock(&wil->wmi_mutex);
 
-       mutex_lock(&wil->p2p_wdev_mutex);
-       wil_abort_scan(wil, false);
-       mutex_unlock(&wil->p2p_wdev_mutex);
-
        wil_mask_irq(wil);
 
        wmi_event_flush(wil);