wil6210: Do no schedule firmware recovery during reset flow
authorHamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Sun, 4 Oct 2015 07:23:27 +0000 (10:23 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Fri, 9 Oct 2015 08:39:21 +0000 (11:39 +0300)
During reset flow, ignore firmware errors detected prior
to the actual hardware reset as the recovery flow would
make additional unnecessary reset.

Signed-off-by: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/wil6210/main.c
drivers/net/wireless/ath/wil6210/wil6210.h

index de6e3c279f97dff232e06ba915515fa7080af184..aade16b126c49b86338b8f90e5a231f89ec4eb09 100644 (file)
@@ -767,6 +767,8 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
        if (wil->hw_version == HW_VER_UNKNOWN)
                return -ENODEV;
 
+       set_bit(wil_status_resetting, wil->status);
+
        cancel_work_sync(&wil->disconnect_worker);
        wil6210_disconnect(wil, NULL, WLAN_REASON_DEAUTH_LEAVING, false);
        wil_bcast_fini(wil);
@@ -853,6 +855,12 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
 void wil_fw_error_recovery(struct wil6210_priv *wil)
 {
        wil_dbg_misc(wil, "starting fw error recovery\n");
+
+       if (test_bit(wil_status_resetting, wil->status)) {
+               wil_info(wil, "Reset already in progress\n");
+               return;
+       }
+
        wil->recovery_state = fw_recovery_pending;
        schedule_work(&wil->fw_error_worker);
 }
index 9a90a58cbc85d7068ebc054a6e79587dd027b822..f619bf234353262607cfccc08b3513b4bdb9e96e 100644 (file)
@@ -409,6 +409,7 @@ enum { /* for wil6210_priv.status */
        wil_status_reset_done,
        wil_status_irqen, /* FIXME: interrupts enabled - for debug */
        wil_status_napi_en, /* NAPI enabled protected by wil->mutex */
+       wil_status_resetting, /* reset in progress */
        wil_status_last /* keep last */
 };