From patchwork Thu Apr 16 09:14:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Achleitner X-Patchwork-Id: 6224961 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8FD22BF4A6 for ; Thu, 16 Apr 2015 09:22:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B3B17202A1 for ; Thu, 16 Apr 2015 09:22:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CF835201C8 for ; Thu, 16 Apr 2015 09:22:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757152AbbDPJWO (ORCPT ); Thu, 16 Apr 2015 05:22:14 -0400 Received: from fopen.at ([151.236.7.194]:47718 "EHLO fopen.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756989AbbDPJWN (ORCPT ); Thu, 16 Apr 2015 05:22:13 -0400 Received: from r90b40zn.localnet (unknown [93.82.221.74]) by fopen.at (Postfix) with ESMTPSA id 3DAA13001FB; Thu, 16 Apr 2015 11:14:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fopen.at; s=mail2014; t=1429175689; bh=QmUQh0zykyF8DFEsKXl0wCZSDYzQHCC/8lRrpN51/h4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UgFoVH2JnlnHG7YmRQllK1WePhgOS6BigVjASr8B1mUjHuthucDvx4p/EJwc7gkgj ScGLnN3JLlJJL4QLlFJQgKklcF+pQIQOmL+OJV1Pwc0X1twnl/BXHpZy0dUFMHpoq/ 7Zsv85mXNTVo1AjkykfLRP6z+q/SV+ITfqtcRmPY= From: Florian Achleitner To: linux-wireless@vger.kernel.org Cc: Amitkumar Karwar , Avinash Patil , Maithili Hinge Subject: [PATCH] mwifiex: Trigger a card reset on "DNLD_CMD: host to card failed". Date: Thu, 16 Apr 2015 11:14:48 +0200 Message-ID: <2350188.9S0zOEq5AR@r90b40zn> User-Agent: KMail/4.14.1 (Linux/3.18.2-031802-generic; KDE/4.14.1; x86_64; ; ) In-Reply-To: <3169170.GKjfvNuGRf@r90b40zn> References: <3169170.GKjfvNuGRf@r90b40zn> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Whenever this problem occurs, the driver can not continue. Thus, trigger a card reset to restart the module firmware. Other firmware communication issues are resolved by this last resort. Also dump registers, to eventually allow some diagnostics. Signed-off-by: Florian Achleitner --- This works well at least for us. drivers/net/wireless/mwifiex/cmdevt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c index c5a14ff..410f4f2 100644 --- a/drivers/net/wireless/mwifiex/cmdevt.c +++ b/drivers/net/wireless/mwifiex/cmdevt.c @@ -233,6 +233,12 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv, spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); adapter->dbg.num_cmd_host_to_card_failure++; + + if (adapter->if_ops.fw_dump) + adapter->if_ops.fw_dump(adapter); + + if (adapter->if_ops.card_reset) + adapter->if_ops.card_reset(adapter); return -1; }