wil6210: do not attempt FW recovery if interface is down
authorVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Tue, 28 Oct 2014 14:50:06 +0000 (16:50 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 30 Oct 2014 19:26:49 +0000 (15:26 -0400)
When interface is down, recovery flow should not be attempted.
Next ndo_open() will trigger target reset, that is FW recovery.

Doing recovery while interface is down cause internal "up", leaving
internal driver state in conflict with network stack. Then, when network
stack will call ndo_open(), kernel oops will be triggered.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/wil6210/main.c

index 6500caf8d609ccd90fae94ce704635df1b50cb16..79003844008a2df9de923c89500a297ad025da26 100644 (file)
@@ -223,6 +223,11 @@ static void wil_fw_error_worker(struct work_struct *work)
 
        wil_dbg_misc(wil, "fw error worker\n");
 
+       if (!netif_running(wil_to_ndev(wil))) {
+               wil_info(wil, "No recovery - interface is down\n");
+               return;
+       }
+
        /* increment @recovery_count if less then WIL6210_FW_RECOVERY_TO
         * passed since last recovery attempt
         */