From patchwork Thu Sep 27 10:38:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 1512991 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 18C01E0010 for ; Thu, 27 Sep 2012 10:39:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756777Ab2I0Kit (ORCPT ); Thu, 27 Sep 2012 06:38:49 -0400 Received: from emh02.mail.saunalahti.fi ([62.142.5.108]:47746 "EHLO emh02.mail.saunalahti.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756731Ab2I0Kio (ORCPT ); Thu, 27 Sep 2012 06:38:44 -0400 Received: from saunalahti-vams (vs3-12.mail.saunalahti.fi [62.142.5.96]) by emh02.mail.saunalahti.fi (Postfix) with SMTP id 63689818C2; Thu, 27 Sep 2012 13:38:43 +0300 (EEST) Received: from emh06.mail.saunalahti.fi ([62.142.5.116]) by vs3-12.mail.saunalahti.fi ([62.142.5.96]) with SMTP (gateway) id A017E551591; Thu, 27 Sep 2012 13:38:43 +0300 Received: from cumari.Elisa (a88-113-65-16.elisa-laajakaista.fi [88.113.65.16]) by emh06.mail.saunalahti.fi (Postfix) with ESMTP id 2F39369983; Thu, 27 Sep 2012 13:38:43 +0300 (EEST) From: Luciano Coelho To: linux-wireless@vger.kernel.org Cc: coelho@ti.com, Ido Yariv , Arik Nemtsov Subject: [PATCH 22/31] wlcore: Don't recover during boot Date: Thu, 27 Sep 2012 13:38:00 +0300 Message-Id: <1348742289-6587-23-git-send-email-luca@coelho.fi> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1348742289-6587-1-git-send-email-luca@coelho.fi> References: <1348742289-6587-1-git-send-email-luca@coelho.fi> X-Antivirus: VAMS Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ido Yariv While recursive recovery is avoided during shutdown, a new recovery may be queued when the FW boots. The recovery work will then try to stop an already stopped hardware, which will most likely result in a kernel panic. Fix this by verifying that wl->state is on before queueing a new recovery. Signed-off-by: Ido Yariv Signed-off-by: Arik Nemtsov Signed-off-by: Luciano Coelho --- drivers/net/wireless/ti/wlcore/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index 7b825e8..3f5d87e 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -775,8 +775,9 @@ void wl12xx_queue_recovery_work(struct wl1271 *wl) WARN_ON(!test_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags)); /* Avoid a recursive recovery */ - if (!test_and_set_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS, &wl->flags)) { + if (wl->state == WLCORE_STATE_ON) { wl->state = WLCORE_STATE_RESTARTING; + set_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS, &wl->flags); wlcore_disable_interrupts_nosync(wl); ieee80211_queue_work(wl->hw, &wl->recovery_work); }