mwifiex: fix the incorrect WARN_ON during suspend
authorVishal Thanki <vishalthanki@gmail.com>
Thu, 7 Apr 2016 21:37:12 +0000 (23:37 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 14 Apr 2016 13:03:44 +0000 (16:03 +0300)
During system suspend, there is a kernel WARNING issued if there
is a pending command present. By marking the wait queue disabled
after calling the command completion routine fixes it.

Signed-off-by: Vishal Thanki <vishalthanki@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/cmdevt.c

index a12adee776c6c6ac76c2f24d3bc44b88a1f5a6af..6f04706464837800c622e43927e6747e6c5f51fb 100644 (file)
@@ -1009,9 +1009,9 @@ mwifiex_cancel_all_pending_cmd(struct mwifiex_adapter *adapter)
        spin_lock_irqsave(&adapter->mwifiex_cmd_lock, cmd_flags);
        /* Cancel current cmd */
        if ((adapter->curr_cmd) && (adapter->curr_cmd->wait_q_enabled)) {
-               adapter->curr_cmd->wait_q_enabled = false;
                adapter->cmd_wait_q.status = -1;
                mwifiex_complete_cmd(adapter, adapter->curr_cmd);
+               adapter->curr_cmd->wait_q_enabled = false;
                /* no recycle probably wait for response */
        }
        /* Cancel all pending command */