Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9985426ybi; Wed, 24 Jul 2019 13:34:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOoqEGR0iDRd0f2U4fxr8RCPHJaYGmuoF6Un7WmbKwLGx6eJQRIH8wTQQ89DUabxcR43mK X-Received: by 2002:a62:cdc8:: with SMTP id o191mr13113242pfg.74.1564000451541; Wed, 24 Jul 2019 13:34:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564000451; cv=none; d=google.com; s=arc-20160816; b=Z0CRjDSMmqKeWVv5geiEn6N3EPu7cW+vr2D/79Dz38OYeP4n4kXSI0x+oNIu3/Y0IC 6jZIJv9PUbV57Ca2OH1DRWTvIy0YjeTP25jQ4BA4naL0t7BPCBqqfk6ZPF9We6SsPfFS olSjInn6/JzvTXSkpRTelOODmSaAMWaYw/ibPUnNhVBKuAYlX25gNYPUDuXsysX1xVPQ +HaXgyRVJFXMoq3aMVqoTDE591RTKGf8CKj7aCY8syLRO0mO35EmWDzMb4d31phncbgP mzTPTmkUvurg8w6xe0fYwvVe+LvmO68DhFtrEpc/bHzFIsANZp0plafYUXaRcRhas9wc IyEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2QOUJBg+XVwcuMNsfQMfToHEjAyaXucNIX/dZLZw754=; b=1EiFo8AYCuw3/Tqg2hXU+K6TXQtp8GFNREs4y+1Vxxig0ftxn0DuxH8dnbFJxBVovu 600R65mGiAzYGXoEdNRvYZzYEPWRpmdAzK6+MQ5t6wH/rMO9caIplU6c+aBU+FZ9a7ob BQZzjxuzWCug4qLJbyDDBkZr8LoEC/TZJIKrPTtSmRTK0/kNVYbF6o6fT68zDW9BLG/T B02lgrZqsXrECbiwHsAI2gxV2mAEsjZ9iQcjSwrqgeBJZnlMOWkCmO3feRsr/MSjsjIT AVl17ERAsSFXhhPi+gMkmjXgrActH/tjL9VTK6hjqEGn21AJ47u5i46g80lEi3q5Rc7+ 006Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mCMn8LJc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 ci23si13184120pjb.85.2019.07.24.13.33.56; Wed, 24 Jul 2019 13:34:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@kernel.org header.s=default header.b=mCMn8LJc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729162AbfGXUb1 (ORCPT + 99 others); Wed, 24 Jul 2019 16:31:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:50626 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388313AbfGXTab (ORCPT ); Wed, 24 Jul 2019 15:30:31 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9B4D920659; Wed, 24 Jul 2019 19:30:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996630; bh=sMDzDsnV3Rj9WChVW7MF4eabmz6uCc1sudHPf2bTMmM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mCMn8LJcwV4EYthUCMvZk73/RbH90gC+6JbZG1Ydy/kpJN4SQIMzK2r9qAwyBJv3o qDRR+FSV2t5ZTMuSo98w3Vsx1BAfiv7+I3xnV7IrdR0Uohez7gALpQBOR8NC+cKaPW T6P34B+s7IlBxeVtqfOrWoNom5bpi5tmt8pvfOcY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqing Pan , Kalle Valo , Sasha Levin Subject: [PATCH 5.2 161/413] ath10k: fix fw crash by moving chip reset after napi disabled Date: Wed, 24 Jul 2019 21:17:32 +0200 Message-Id: <20190724191746.602512161@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 08d80e4cd27ba19f9bee9e5f788f9a9fc440a22f ] 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,QCA9887,WCN3990 Signed-off-by: Miaoqing Pan Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- 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 2c27f407a851..6e5f7ae00253 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); -- 2.20.1