Received: by 10.213.65.68 with SMTP id h4csp500946imn; Fri, 16 Mar 2018 09:39:28 -0700 (PDT) X-Google-Smtp-Source: AG47ELu7gX0rylh6DXDo+n+XkUhopYOelw/nCD+TYv4MkbJXVSYqz8NAKsfFjYRADKdttP7i54yZ X-Received: by 10.167.130.88 with SMTP id e24mr2122008pfn.66.1521218368214; Fri, 16 Mar 2018 09:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521218368; cv=none; d=google.com; s=arc-20160816; b=bFlQrSZUTWbfSSyYEjtYimQiYmP7TQVaMqcynZbx+n4MV4jRFM2icuvdEBQ5+aV9dJ QEn7j/EE1S05GyLlh7vLsesz83eHXW+lw+ot2okF5fzw7CXvx/1AaI8dpWoUdGowidQ6 i7iZfuZICwk/V9Nbum1EcRcBjXaXZ9Uu1b9vVDIYGJQFuvTVZYKC7QfvxvE28nVm8x6M z3XGjuudplVfu7J/WhX6naFbNGcmG45BNW5njhvJ+oPMpsCrTMKZHEkuO6e0jbrF9umc S3J7g1E7o+EpJkVUJzfaz2hEBZcZNgccUHE/oYeon1deQm1vGolmEsqHIW23v/3OtjQ3 g1yQ== 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=YyDe9nuFG9RaNEebmWhqes86o5U3yyqcDTMoA9Q2KME=; b=Cb1e8pb3UHdlBya9OOXocHlsQ7HS8cG3Y2SeoHNwu1qSluKmrfoqCRYj+rVY07W1yL Zasdqs/H+0sMrY9yU6D0CzDk4B1GpcDl5rEc+Vot6mIkkEJwexX/LFZcxhPuM6BpxWMh 21qEuzmMeswvr0HoJ9ug75KPT8Jl/IEStFQdCR3i8PKpvuZxl3ykNTYCUX/Uy5TKU5Bf vsFcbhKMrxtKDdVZ13zUt18OIpmeSAizYfcvwX8mjMyM4bPaTUKTfd48VMI2o0OV6mpO Zfu+YbptkXOt6qp91dZxYFwMFIDg7FqTXNdOm1f7u7/MmV18078mPdK7lKDsO+4grf6D 3BFA== 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 j184si5214626pgc.142.2018.03.16.09.39.14; Fri, 16 Mar 2018 09:39:28 -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 S1753212AbeCPQiC (ORCPT + 99 others); Fri, 16 Mar 2018 12:38:02 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40704 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934089AbeCPPhJ (ORCPT ); Fri, 16 Mar 2018 11:37:09 -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 248281221; Fri, 16 Mar 2018 15:37: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.14 074/109] iwlwifi: mvm: avoid dumping assert log when device is stopped Date: Fri, 16 Mar 2018 16:23:43 +0100 Message-Id: <20180316152334.002036821@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152329.844663293@linuxfoundation.org> References: <20180316152329.844663293@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.14-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 @@ -603,6 +603,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])