Received: by 10.213.65.68 with SMTP id h4csp480082imn; Fri, 16 Mar 2018 09:02:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELtYeKNcW02M6URpLz1vRb13/sWNnd0rIQ5Dbv2KTxhZm2xrQvQZY89su3kyK5lPU1aMDc+5 X-Received: by 10.99.164.25 with SMTP id c25mr1876590pgf.235.1521216137398; Fri, 16 Mar 2018 09:02:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521216137; cv=none; d=google.com; s=arc-20160816; b=VLySMBBQUF2bXe6wmHoU8cVa7Ap+70d+jrErmFUTn6AGKMleEzK4ekhbVPp0kh6hUV VnOwYNM+vOwJwNnzBOlz8HW+DFbz3e3p7I+QKvXKwQOcZ2B4Yh2SpFrwlqVCN0d0uHHq 4d1IqmGn52M96Pf/QZqP2TosKYyf50eAm683Z6MrpCfzzkBgvAvt8ygmtAiPyUZ+qYPh J2f50+5kbyKEkqI7h8jfyxUB4bT72d8gn7rYi19mJ1ALf8+XEX1O3zOsROhrd0cxXZn/ pKsfUqPzArmKJRnFCKij2BK4GbKyJisoR/19xbbtNuMwPqs+EGdyU3inCRzGW8HoOyuk liBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=iD+CtoaoxW6HGcJ6YSL/dmqp6jDKjiiggSm0mjNVzYk=; b=X3m60A8J0SnrgzlR9HFy5+68Gi+Mx2PsWwVb8xooPdQVDpolHkynnCAxytSKO88BdL /ZFrwGthX6gdQSA/sI3rh0fv46d/LkS81eAjEbKwBuuzncLBSwTlFBym857OiAxIS9Hr 6k5+g9nXMn6MWdawSM0cDR6bJBF/tHGSes/SczcshOBqHQWaoPr4lOJKGXFIpPWy0dKC +2LgFibb8cniUGe/2M2uPU48JdThJrvlUK3vt6YqFwMktrjRLVrNh0ch5sPzdiHty+N1 UtjN9zxPUzEfB2BfGANeW3pydwIPfzUXK5p7kJ5UGPjwpZxPGDAU9L7A2zqgho1Kohva dmjQ== ARC-Authentication-Results: i=1; mx.google.com; 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 t10-v6si1996352plq.531.2018.03.16.09.01.48; Fri, 16 Mar 2018 09:02:17 -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; 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 S965213AbeCPPnL (ORCPT + 99 others); Fri, 16 Mar 2018 11:43:11 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44788 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933278AbeCPPnI (ORCPT ); Fri, 16 Mar 2018 11:43:08 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6CDA6E1F; Fri, 16 Mar 2018 15:43:07 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sara Sharon , Luca Coelho , Sasha Levin Subject: [PATCH 4.15 089/128] iwlwifi: mvm: avoid dumping assert log when device is stopped Date: Fri, 16 Mar 2018 16:23:50 +0100 Message-Id: <20180316152341.004217290@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152336.199007505@linuxfoundation.org> References: <20180316152336.199007505@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sara Sharon [ Upstream commit 6362ab721ef5c4ecfa01f53ad4137d3d984f0c6c ] We might erroneously get to error dumping code when the device is already stopped. In that case the driver will detect a defective value and will try to reset the HW, assuming it is only a bus issue. The driver than proceeds with the dumping. The result has two side effects: 1. The device won't be stopped again, since the transport status is already stopped, so the device remains powered on while it actually should be stopped. 2. The dump in that case is completely garbaged and useless. Detect and avoid this. It will also make debugging such issues easier. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c @@ -595,6 +595,12 @@ static void iwl_mvm_dump_lmac_error_log( void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm) { + if (!test_bit(STATUS_DEVICE_ENABLED, &mvm->trans->status)) { + IWL_ERR(mvm, + "DEVICE_ENABLED bit is not set. Aborting dump.\n"); + return; + } + iwl_mvm_dump_lmac_error_log(mvm, mvm->error_event_table[0]); if (mvm->error_event_table[1])