Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1683284ybm; Tue, 21 May 2019 19:22:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPIeHLXDvuCO8yGtEC/iKgt4ucEFTCxae9GHAYZr1SktaxNsVKi8H6XNBWyW++z7LqVTJ2 X-Received: by 2002:a63:fc55:: with SMTP id r21mr86340259pgk.441.1558491725545; Tue, 21 May 2019 19:22:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558491725; cv=none; d=google.com; s=arc-20160816; b=G1eiaxrJGujt/d00mpJ9YDVAmIBq2JqKn8m1iV3O8GGKcpGw3OmfkroPtJ0la+6E0G o80oQTI1JOij269rCiUbXx+hyZBGa+eLkC1SREa+5Lhf1wda3OIzPM/y2C4YfaUd3ZYN V8xsQppAaB8tZPaSktOWwcyVapH002Mv3hx5KKimxStAVUUlBq2SK2aAso92lO0Qavvj 3q87PKG9w3qfoMVUAZ9a/xX6FFpEcbIYIprkVPaH1wnoPdh/pyVX3+knpLbS8HNhV8jI KLcjV3CLLwmLsDZ+GyU4Gxf5KKqRGh3nSaT85hx5IulSBNZ1T1azWXEpfkl3uAUsvxQ8 l9hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature; bh=xeQaDU5Qp+jjaeZynT6dZPEcCiChXRbfqXSSQh/1ssk=; b=qZQHTcwf6GYbNhOdclT9hrNE+f2+p1cPp0PrCXbnbx+QvkPZ3nUid4sMQ42i6sjz4X dKr5wnNpunLqTcf+FZj+/5/DTnrnomsFAK1UzSVnrZ4EkVNdNJV0zjy8P3GPEsbabw3W 5ZWHmu7EgY19/8uHFIBc32zCtxdwCAEWwzJq1ORVRtjQIz8v1Dno6JZ7+PDFx5aJcTGf xM/yIGy23wOmcoGZK7j5j3CT5S63qwv+4dVZn6C2QdoLXvHcoB4vLFOAsHe8DjMI5PHK /ePqomMyv6CgMuSMfDFhMp+vw0xS6BeEueOyRT6lj31ebElB471vyaHnB3Wq9mBcx1wF g26g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=VWIgSzC8; dkim=pass header.i=@codeaurora.org header.s=default header.b=VWIgSzC8; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r204si25684351pfc.263.2019.05.21.19.21.35; Tue, 21 May 2019 19:22:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=VWIgSzC8; dkim=pass header.i=@codeaurora.org header.s=default header.b=VWIgSzC8; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728031AbfEVCTL (ORCPT + 99 others); Tue, 21 May 2019 22:19:11 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:35766 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726466AbfEVCTL (ORCPT ); Tue, 21 May 2019 22:19:11 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C8A6C60AA3; Wed, 22 May 2019 02:19:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1558491550; bh=SkQsYv4Wzws1m6n6fKUkPgVyPK6fBZDnqCfcZxGDIqM=; h=From:To:Cc:Subject:Date:From; b=VWIgSzC85BSAlK4jLsVCEEHGUtkvBaUaB4qo6R5/K2OF8BCPbjNzw8HaDhP1dxjCD m1Nt3gABj1hwUnwkEFdJmBo84yTnbHr4xKKVU0Ui+Qogho4NQckug9pC4VChtQ2Hb5 OYQv+IyGqB34YpFo/D/R1QoRQJijgGCz3p9AVqxM= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED,SPF_NONE autolearn=no autolearn_force=no version=3.4.0 Received: from smtp.codeaurora.org (unknown [180.166.53.21]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: miaoqing@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3222E607DF; Wed, 22 May 2019 02:19:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1558491550; bh=SkQsYv4Wzws1m6n6fKUkPgVyPK6fBZDnqCfcZxGDIqM=; h=From:To:Cc:Subject:Date:From; b=VWIgSzC85BSAlK4jLsVCEEHGUtkvBaUaB4qo6R5/K2OF8BCPbjNzw8HaDhP1dxjCD m1Nt3gABj1hwUnwkEFdJmBo84yTnbHr4xKKVU0Ui+Qogho4NQckug9pC4VChtQ2Hb5 OYQv+IyGqB34YpFo/D/R1QoRQJijgGCz3p9AVqxM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3222E607DF 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=miaoqing@codeaurora.org Received: by smtp.codeaurora.org (sSMTP sendmail emulation); Wed, 22 May 2019 10:19:04 +0800 From: Miaoqing Pan To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Miaoqing Pan Subject: [PATCH] ath10k: fix fw crash by moving chip reset after napi disabled Date: Wed, 22 May 2019 10:18:29 +0800 Message-Id: <1558491509-7755-1-git-send-email-miaoqing@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On SMP platform, when continuously running wifi up/down, the napi poll can be scheduled during chip reset, which will call ath10k_pci_has_fw_crashed() to check the fw status. But in the reset period, the value from FW_INDICATOR_ADDRESS register will return 0xdeadbeef, which also be treated as fw crash. Fix the issue by moving chip reset after napi disabled. ath10k_pci 0000:01:00.0: firmware crashed! (guid 73b30611-5b1e-4bdd-90b4-64c81eb947b6) ath10k_pci 0000:01:00.0: qca9984/qca9994 hw1.0 target 0x01000000 chip_id 0x00000000 sub 168c:cafe ath10k_pci 0000:01:00.0: htt-ver 2.2 wmi-op 6 htt-op 4 cal otp max-sta 512 raw 0 hwcrypto 1 ath10k_pci 0000:01:00.0: failed to get memcpy hi address for firmware address 4: -16 ath10k_pci 0000:01:00.0: failed to read firmware dump area: -16 ath10k_pci 0000:01:00.0: Copy Engine register dump: ath10k_pci 0000:01:00.0: [00]: 0x0004a000 0 0 0 0 ath10k_pci 0000:01:00.0: [01]: 0x0004a400 0 0 0 0 ath10k_pci 0000:01:00.0: [02]: 0x0004a800 0 0 0 0 ath10k_pci 0000:01:00.0: [03]: 0x0004ac00 0 0 0 0 ath10k_pci 0000:01:00.0: [04]: 0x0004b000 0 0 0 0 ath10k_pci 0000:01:00.0: [05]: 0x0004b400 0 0 0 0 ath10k_pci 0000:01:00.0: [06]: 0x0004b800 0 0 0 0 ath10k_pci 0000:01:00.0: [07]: 0x0004bc00 1 0 1 0 ath10k_pci 0000:01:00.0: [08]: 0x0004c000 0 0 0 0 ath10k_pci 0000:01:00.0: [09]: 0x0004c400 0 0 0 0 ath10k_pci 0000:01:00.0: [10]: 0x0004c800 0 0 0 0 ath10k_pci 0000:01:00.0: [11]: 0x0004cc00 0 0 0 0 Tested HW: QCA9984 Tested FW: 10.4-3.9.0.2-00035 Signed-off-by: Miaoqing Pan --- drivers/net/wireless/ath/ath10k/pci.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 2bd6cba..80bcb2e 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -2059,6 +2059,11 @@ static void ath10k_pci_hif_stop(struct ath10k *ar) ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif stop\n"); + ath10k_pci_irq_disable(ar); + ath10k_pci_irq_sync(ar); + napi_synchronize(&ar->napi); + napi_disable(&ar->napi); + /* Most likely the device has HTT Rx ring configured. The only way to * prevent the device from accessing (and possible corrupting) host * memory is to reset the chip now. @@ -2072,10 +2077,6 @@ static void ath10k_pci_hif_stop(struct ath10k *ar) */ ath10k_pci_safe_chip_reset(ar); - ath10k_pci_irq_disable(ar); - ath10k_pci_irq_sync(ar); - napi_synchronize(&ar->napi); - napi_disable(&ar->napi); ath10k_pci_flush(ar); spin_lock_irqsave(&ar_pci->ps_lock, flags); -- 1.9.1