From patchwork Fri Apr 14 21:51:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 9681815 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9757060386 for ; Fri, 14 Apr 2017 21:52:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88A1C1FF29 for ; Fri, 14 Apr 2017 21:52:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D34E1FFD6; Fri, 14 Apr 2017 21:52:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B8B51FF29 for ; Fri, 14 Apr 2017 21:52:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755355AbdDNVvx (ORCPT ); Fri, 14 Apr 2017 17:51:53 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:36084 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754977AbdDNVvs (ORCPT ); Fri, 14 Apr 2017 17:51:48 -0400 Received: by mail-pf0-f174.google.com with SMTP id 194so5564091pfv.3 for ; Fri, 14 Apr 2017 14:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=i2gzwpCtg+wjcecwdymm7HKT8qCoCGq0wPVjKFCxrS4=; b=MUjHmTbgqmdFXETu1/0YUWvDBrw8vSe5ft77O4cH903cghAqfIoQCsLGB7MRtFuXdM 0dTT/8Pn4VxG2O1DJhrLnyjR10iEaala82gKXP4Ro/EY81DQlSyHtrnNCcOEcscRH9nq CQpRguy6AYWhlYZi8PMjG09ee9tsonwTpWwgI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=i2gzwpCtg+wjcecwdymm7HKT8qCoCGq0wPVjKFCxrS4=; b=hlDzUZMwZrF6WsV/YqQISMsAYV0+Aqkh5AgT9Pdws38youlLkH1TJTKA/ZgnVBDbda 9T1S72sIInNI9nzyCHuiP8ckR9aXsu5s+Kx07y4zVy6sckanwu9ACIhBBhZEE1afHOnq Z6kinQHI7qiQESWV3DFtZCbTTKUjBa2U0WTrXeamQV3TomUj+lSdT1beTJJnskF8GTKk 8jDZic2rLMa3VCRlMizjDk6h6aNlDsY/mzoUGHBztGyibYm4Jm88FGDE+TnT1Mullegj DKsKXkJEzW8sFN6TSTIUf4VYibc7eZb22m/1uFzaUULUK2duBlz49pTdkZ5h2PtsAbeD fv4Q== X-Gm-Message-State: AN3rC/7HBdCfOtdqwh8oEYPM5Rxb2mvQEQJL3AwdbKVzBzIubcLUJHIs rQ+6I8raKS5dT7vn X-Received: by 10.99.60.90 with SMTP id i26mr9161377pgn.231.1492206707816; Fri, 14 Apr 2017 14:51:47 -0700 (PDT) Received: from ban.mtv.corp.google.com ([172.22.64.120]) by smtp.gmail.com with ESMTPSA id n85sm4879081pfi.101.2017.04.14.14.51.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Apr 2017 14:51:47 -0700 (PDT) From: Brian Norris To: Ganapathi Bhat , Nishant Sarmukadam Cc: , Dmitry Torokhov , Kalle Valo , linux-wireless@vger.kernel.org, Brian Norris Subject: [PATCH 2/4] mwifiex: reset timeout flag when resetting device Date: Fri, 14 Apr 2017 14:51:18 -0700 Message-Id: <20170414215120.145038-2-briannorris@chromium.org> X-Mailer: git-send-email 2.12.2.762.g0e3151a226-goog In-Reply-To: <20170414215120.145038-1-briannorris@chromium.org> References: <20170414215120.145038-1-briannorris@chromium.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If we reset because of a command timeout, we should reset this flag. Otherwise, we might erroneously think the next command after reset is timing out, and trigger another reset. The above behavior effectively neuters the automatic card_reset() behavior, as it means we will never recover from a command timeout properly (and in fact, we might enter an infinite loop: timeout -> reset -> (fake) timeout -> reset -> ... This fixes a bug introduced with introduction of PCIe function level reset support, but it was carried into the SDIO driver when it was converted to use the same codepaths. And this is currently mostly a problem only in the SDIO driver, because it's the only one with automatic card_reset() support (e.g., on command timeout). But it will be a problem for PCIe too, as I'm working on supporting automatic card_reset() for PCIe. Fixes: c742e623e941 ("mwifiex: sdio card reset enhancement") Fixes: 4c5dae59d2e9 ("mwifiex: add PCIe function level reset support") Signed-off-by: Brian Norris --- drivers/net/wireless/marvell/mwifiex/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index 912b687f4671..89eccd7adbe5 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -1441,6 +1441,7 @@ mwifiex_reinit_sw(struct mwifiex_adapter *adapter) init_waitqueue_head(&adapter->init_wait_q); adapter->is_suspended = false; adapter->hs_activated = false; + adapter->is_cmd_timedout = 0; init_waitqueue_head(&adapter->hs_activate_wait_q); init_waitqueue_head(&adapter->cmd_wait_q.wait); adapter->cmd_wait_q.status = 0;