Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1972823ima; Thu, 25 Oct 2018 07:46:56 -0700 (PDT) X-Google-Smtp-Source: AJdET5cu1kdCO9aYObASwnYWeVaB4hxour6xtcppET+V4RX9gI6ZgWkI6up5OOZri7KiZhq/wLE8 X-Received: by 2002:a65:655a:: with SMTP id a26-v6mr1713194pgw.389.1540478816230; Thu, 25 Oct 2018 07:46:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540478816; cv=none; d=google.com; s=arc-20160816; b=aLh3JQe5xX26kz0nd6/JjtkKdKKcp79HuwXkZrRT/ipalvYYsNu07OhH9SnE8/h+4W +CpcwLtn2mXGyviUJydsJY3Q2osUBcTqdOBXo/ithyMlHOBMXVS/FI+vtZ7T/LRIVvO6 fnHCGr/T2Bfgs6ocJhD28t/+Ncf4sTlcD4M068cEDMbxdHHwFchx3o5UDeCKIkaZDepm wV8owle+hSO0hmirfWURjvPxBvAw5rAo+DOSKta6bAupsQ1t4vkui5PvlMG9Ek4fNBZG xVhn1AUB+BjbjVK7IoBJ//TY1ptYEXUw2CgspwQAd46N1rAA9rbJauq3iWBsn8hn3AON fOfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=4L26/h4c2d9GWqZdPt/uwC2jq1K4csIyOZ5jaghsO5c=; b=Xr2QLFmsVXLLIMqPcKbLDjnTuMIcDlImyLtBOWp6qOlOOQBnc5J41xRz8pqpOj1Kz0 x44Gt2f7uZq5Au//IExBWR2IlaJsdBQ9XO2GY1DlgM8+9ZB7HDu7+jNp6ihKWP1k/WHV 5grVr8Nb+UE/UhXgc3pRmh5AqRq3TYrb27pncy89bkCppoMopQXd4QtdNLbjTlgjET5I 8EFN1LxZ6MurL6iYrlrSKVTbsSfReRn7Br8abdSm5h73MpgwO836bubOhTmyIrr3xIfm 1/xsWiwLQdS1hCOTtRrXCPO4LWtjsWOAFJqoOefmDSK/5rmcq5/iFaEMQLUsprfJ9UTa rKiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mHAokU4+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g28-v6si8098924pgg.384.2018.10.25.07.46.39; Thu, 25 Oct 2018 07:46:56 -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=mHAokU4+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727787AbeJYWny (ORCPT + 99 others); Thu, 25 Oct 2018 18:43:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:52362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727699AbeJYWnx (ORCPT ); Thu, 25 Oct 2018 18:43:53 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 76C3F20834; Thu, 25 Oct 2018 14:10:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540476658; bh=r0K3yHq+ZRm6DwY7LPP3K3WxyBUiTgutfizntv/k8WU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mHAokU4+DoopFTArWlek3mstbpOMkMPlvm0mlfSjGxmgPYnyAMBy+FIe+fsPNrTsv UYm3V/IhReLeer0ykKPtRLon08vttYfUn/VFeVJYr0Y0cQfFaqZHhQ/H3mkcyUpIS7 BzWenjHwE7pRzGHtQfiP8KisITRW1lNTvPC4tOjk= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Liad Kaufman , Luca Coelho , Sasha Levin Subject: [PATCH AUTOSEL 4.14 02/46] iwlwifi: dbg: allow wrt collection before ALIVE Date: Thu, 25 Oct 2018 10:10:09 -0400 Message-Id: <20181025141053.213330-2-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141053.213330-1-sashal@kernel.org> References: <20181025141053.213330-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Liad Kaufman [ Upstream commit dfd4b08cf44f27587e2053e006e43a1603328006 ] Even if no ALIVE was received, the WRT data can still be collected. Add this. Signed-off-by: Liad Kaufman Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c index 2fa7ec466275..839010417241 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c @@ -950,7 +950,20 @@ int iwl_fw_dbg_collect_desc(struct iwl_fw_runtime *fwrt, if (trigger) delay = msecs_to_jiffies(le32_to_cpu(trigger->stop_delay)); - if (WARN(fwrt->trans->state == IWL_TRANS_NO_FW, + /* + * If the loading of the FW completed successfully, the next step is to + * get the SMEM config data. Thus, if fwrt->smem_cfg.num_lmacs is non + * zero, the FW was already loaded successully. If the state is "NO_FW" + * in such a case - WARN and exit, since FW may be dead. Otherwise, we + * can try to collect the data, since FW might just not be fully + * loaded (no "ALIVE" yet), and the debug data is accessible. + * + * Corner case: got the FW alive but crashed before getting the SMEM + * config. In such a case, due to HW access problems, we might + * collect garbage. + */ + if (WARN((fwrt->trans->state == IWL_TRANS_NO_FW) && + fwrt->smem_cfg.num_lmacs, "Can't collect dbg data when FW isn't alive\n")) return -EIO; -- 2.17.1