From patchwork Tue Jan 29 09:26:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rakesh Pillai X-Patchwork-Id: 10785857 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 69FA8139A for ; Tue, 29 Jan 2019 09:26:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 582F52B2C8 for ; Tue, 29 Jan 2019 09:26:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C5702B45F; Tue, 29 Jan 2019 09:26:32 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EB2E52B2C8 for ; Tue, 29 Jan 2019 09:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=WnXl4H6VlZnm9rMkagpjYFIFBM6F8bIIt9iWVG/Jonc=; b=VRm 2+vrRYRJ6d8QxnuhY7gdfj4lhK+IH7WCi3mTnoE4l+zXUSto76EEvp7xoXXHBS+MdsNmKEXV5vb+B EIxWEKisO5w5Fd6lJKhgUQoNaw77aTjiGsbV1Hp84NX9iHyC8ypZXGQQgITMbyf33ZAPElYmIPJE4 aFWdbYk6OvFT1v5W6MdQZBon2Hih9csIwh3i5DG5ZCbw1uXibQBXcyJTfakgHGy+zrCbcfTjd/SyE tU5anEUD35QPhFiqSMuKcUFYybGJez8+415hWrmV9E8eCwhwADQVUm2oyp0Asd5n3RrNsf1aZFQDR C6fKD/cQutoEIs3GpZvSPpvytgFcVnQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1goPf2-0005au-EZ; Tue, 29 Jan 2019 09:26:28 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1goPev-0005Ql-OG for ath10k@lists.infradead.org; Tue, 29 Jan 2019 09:26:26 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3D1106047C; Tue, 29 Jan 2019 09:26:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1548753979; bh=Sgr1tHTdnB7QIVv5RBDiZ/e0sXKSWbLTd9EPIBIiq9U=; h=From:To:Cc:Subject:Date:From; b=gVsVQMgvrlzpkfNpI8MeMP5DNJtfOrJioWhp1OzHS629HTQ/k22Y4V9QEW9nHmE9s hJWU5puHWtJEkK5LuLvi9rfAZp3Uhp6PCGs0qIDb1EZc++71IwWxKm2rBirPH1auYH vSuKxCc+VzKnMYSY2sivmoz4sY/D0bWJtQASPxIk= Received: from pillair-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pillair@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 6F204601D1; Tue, 29 Jan 2019 09:26:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1548753976; bh=Sgr1tHTdnB7QIVv5RBDiZ/e0sXKSWbLTd9EPIBIiq9U=; h=From:To:Cc:Subject:Date:From; b=Z42UYIknRASEOxQWnrAOczY2U76CaFBJcHgHdHtUwn3Cz/oq+6+vCjjys7RLe9qOO 3x+W78U7VmOCxGzhtlSGuJribVOwNmV+myBTQhQ1hwps8vKmMFm6FAMC9XpbvnonXG 4wVX/o8FkJM/bEeM2N9hPrUeQi91GWHwQvc5asQE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6F204601D1 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=pillair@codeaurora.org From: Rakesh Pillai To: ath10k@lists.infradead.org Subject: [PATCH] ath10k: Fix hw-restart crash inject mode for WCN3990 Date: Tue, 29 Jan 2019 14:56:07 +0530 Message-Id: <1548753967-2233-1-git-send-email-pillair@codeaurora.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190129_012622_214059_F0EB0C02 X-CRM114-Status: GOOD ( 13.46 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rakesh Pillai , linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The hw-restart crash inject mode is a special mode, where there is no crash generated in the firmware, but instead the driver restarts the firmware. In order to restart WCN3990 firmware, the driver needs to send qmi_wlan_disable message followed by the qmi_wlan_enable message to the WCN3990 firmware. Currently the qmi_wlan_disable message is not sent to the WCN3990 firmware when hw-restart crash is injected, which causes the firmware to crash when the driver sends qmi_wlan_enable message during ath10k_restart. Send qmi_wlan_disable to the WCN3990 firmware when the hw-restart crash is injected via debugfs. Tested HW: WCN3990 Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1 Signed-off-by: Rakesh Pillai --- drivers/net/wireless/ath/ath10k/snoc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index 54efe6b..cceb6d4 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.c +++ b/drivers/net/wireless/ath/ath10k/snoc.c @@ -1000,7 +1000,16 @@ static int ath10k_snoc_wlan_enable(struct ath10k *ar) static void ath10k_snoc_wlan_disable(struct ath10k *ar) { - if (!test_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags)) + struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); + + /* If both ATH10K_FLAG_CRASH_FLUSH and ATH10K_SNOC_FLAG_RECOVERY + * flags are not set, it means that the driver has restarted + * due to a crash inject via debugfs. In this case, the driver + * needs to restart the firmware and hence send qmi wlan disable, + * during the driver restart sequence. + */ + if (!test_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags) || + !test_bit(ATH10K_SNOC_FLAG_RECOVERY, &ar_snoc->flags)) ath10k_qmi_wlan_disable(ar); }