From patchwork Wed Nov 14 02:50:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Gong X-Patchwork-Id: 10681879 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 C9DB714E2 for ; Wed, 14 Nov 2018 02:51:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF37C2B2C1 for ; Wed, 14 Nov 2018 02:51:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B34152B2DE; Wed, 14 Nov 2018 02:51:01 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW 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 441F12B2C1 for ; Wed, 14 Nov 2018 02:51:01 +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=hHtCjUbyPZhXiP+4RIG+fSLtcoJ9K/jG17vIumt2Z+Y=; b=R90 HdSdTyAvV9h4XdUd2emrcqavTtnpY3qLq3i6t105ZHj5fmdf3YZ5XzSV/+MdnSnZhnyGWgKb9iSUO q4YojORi1kh7cqbltlGLTKx+4Dpfho5zGLV3R/irj2hCLkABjisHKNEjH1W70xYVm508GNgHjwOkz uWzTRf9XJijL1nwxuXQnh9HJxGAUOMG3fKCqf16vuEQPIOBGcZNR0dl0aoQd2xPuRFVw/dPX8F95v Oxlq06kw5FYHahGO6epdNxNfR+0YHsx8jH1fXbqXCduCj6RyXxl+ZUdnL04COeSm6+IIb//vGFek+ ifflfx6WZwldj2urrgwycSM+gAkvrRQ==; 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 1gMlGZ-0005RJ-Ot; Wed, 14 Nov 2018 02:50:55 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMlGT-0005R9-CU for ath10k@bombadil.infradead.org; Wed, 14 Nov 2018 02:50:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ri4ma5gprIHLDHGXAMBtnL1XCVfRTJfmEcyiQjBgcwI=; b=AqnTU0jgFhynszuGtp5Lk3mK1 52G4ZeNLOJmsqjqHMKe5UZd1ZwJxCyz0EBMiucsEkqlw6cSMs6d36BWCNwUdW+puCZdxizUChDqU2 YKyQpq9aqxo+wR3/rutGVwmWo3JyaE4YtImJZQ7Q7NhWer02nWg5FSR6EbMACAIkF9cIngwRCZqR1 tJdPddfa6L1PuylFf8Ok6SW3dceRQkX9tk/yLsb8e3ENbPYj7noaOaAW0ChwpeAeYTFoamNWSCDLv x9hUsXKShfUHBs7IJPYhPUz9qatEKsvJkHG+8lATNfqwZnJ0aeFj0walDxbLq3n1M7DWT5RqALJeu C6TVSKFJw==; Received: from smtp.codeaurora.org ([198.145.29.96]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMlGQ-0003jA-5b for ath10k@lists.infradead.org; Wed, 14 Nov 2018 02:50:47 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 029B26071B; Wed, 14 Nov 2018 02:50:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1542163833; bh=+8tDCNVT4M1W73lvpP5wmFls8NXiVP5sM3RPOl+7dIk=; h=From:To:Cc:Subject:Date:From; b=MLxdF8oiaVi0p2muO5OrPRAj3n81DUMt4w1QOAuB0qex/z4kHIMSLmaaWMn1938jd c86XlRZbiBQPa5wGRNwdUcpuRu3Eii8es23rTSfSuPFQDLyozji876KJRsi+Ef9TWc P2vN9ZbJjRjIsnXqUkKM8JVyS2dO1xIVvN4qDl10= Received: from localhost.localdomain (unknown [180.166.53.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: wgong@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id DBBC76028D; Wed, 14 Nov 2018 02:50:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1542163832; bh=+8tDCNVT4M1W73lvpP5wmFls8NXiVP5sM3RPOl+7dIk=; h=From:To:Cc:Subject:Date:From; b=dE1GvX4rSaz9v2ZUkKMnS8smSHQwqz8CpKDNtPf+HYteI1hpImJ+La0GzVDkNfsn8 PgwCCMIQZALWjrL0IcRyo1xO/jQ3QY2WJg7QGyYVz9nVDTLIX26wDtSfbR7PWfr4a7 vi1zqf3ZDoC5y0Kqz+FKmZT1iTBdFcqisSLmW4Ik= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org DBBC76028D 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=wgong@codeaurora.org From: Wen Gong To: ath10k@lists.infradead.org Subject: [PATCH] ath10k: Remove ATH10K_STATE_RESTARTED in simulate fw crash Date: Wed, 14 Nov 2018 10:50:24 +0800 Message-Id: <1542163824-795-1-git-send-email-wgong@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181114_025046_350473_B4DA08E4 X-CRM114-Status: GOOD ( 11.03 ) 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: 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 When test simulate firmware crash, it is easy to trigger error. command: echo soft > /sys/kernel/debug/ieee80211/phyxx/ath10k/simulate_fw_crash. If input more than two times continuously, then it will have error. Error message: ath10k_pci 0000:02:00.0: failed to set vdev 1 RX wake policy: -108 ath10k_pci 0000:02:00.0: device is wedged, will not restart It is because the state has not changed to ATH10K_STATE_ON immediately, then it will have more than two simulate crash process running meanwhile, and complete/wakeup some field twice, it destroy the normal recovery process. Tested with QCA6174 PCI with firmware WLAN.RM.4.4.1-00109-QCARMSWPZ-1, but this will also affect QCA9377 PCI. It's not a regression with new firmware releases. Signed-off-by: Wen Gong --- drivers/net/wireless/ath/ath10k/debug.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index ada29a4..dc8700b 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -569,8 +569,7 @@ static ssize_t ath10k_write_simulate_fw_crash(struct file *file, mutex_lock(&ar->conf_mutex); - if (ar->state != ATH10K_STATE_ON && - ar->state != ATH10K_STATE_RESTARTED) { + if (ar->state != ATH10K_STATE_ON) { ret = -ENETDOWN; goto exit; }