All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
	Shahar S Matityahu <shahar.s.matityahu@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH v2 14/14] iwlwifi: wrt: add fw force restart via triggers
Date: Wed, 28 Mar 2018 22:54:20 +0300	[thread overview]
Message-ID: <20180328195420.24737-1-luca@coelho.fi> (raw)
In-Reply-To: <20180328195253.24380-1-luca@coelho.fi>

From: Shahar S Matityahu <shahar.s.matityahu@intel.com>

We can set triggers that cause a debug data collection when something
of interest happens (e.g. when too many probes are lost conscutively).
Normally, this triggers don't cause the FW to be restarted, but in
some cases that may be desired, so we recover from the problem.  To
support this, add a flag that indicates that the FW should be
restarted when the trigger fires.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/dbg.c  |  6 ++++++
 drivers/net/wireless/intel/iwlwifi/fw/file.h | 12 +++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
index d27a43ea0d7c..fa283285fcbe 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
@@ -1008,6 +1008,12 @@ int iwl_fw_dbg_collect(struct iwl_fw_runtime *fwrt,
 {
 	struct iwl_fw_dump_desc *desc;
 
+	if (trigger && trigger->flags & IWL_FW_DBG_FORCE_RESTART) {
+		IWL_WARN(fwrt, "Force restart: trigger %d fired.\n", trig);
+		iwl_force_nmi(fwrt->trans);
+		return 0;
+	}
+
 	desc = kzalloc(sizeof(*desc) + len, GFP_ATOMIC);
 	if (!desc)
 		return -ENOMEM;
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h
index 2bea95bf4fc9..9b2805e1e3b1 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/file.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h
@@ -620,6 +620,14 @@ enum iwl_fw_dbg_trigger_mode {
 	IWL_FW_DBG_TRIGGER_MONITOR_ONLY = BIT(2),
 };
 
+/**
+ * enum iwl_fw_dbg_trigger_flags - the flags supported by wrt triggers
+ * @IWL_FW_DBG_FORCE_RESTART: force a firmware restart
+ */
+enum iwl_fw_dbg_trigger_flags {
+	IWL_FW_DBG_FORCE_RESTART = BIT(0),
+};
+
 /**
  * enum iwl_fw_dbg_trigger_vif_type - define the VIF type for a trigger
  * @IWL_FW_DBG_CONF_VIF_ANY: any vif type
@@ -656,6 +664,7 @@ enum iwl_fw_dbg_trigger_vif_type {
  * @occurrences: number of occurrences. 0 means the trigger will never fire.
  * @trig_dis_ms: the time, in milliseconds, after an occurrence of this
  *	trigger in which another occurrence should be ignored.
+ * @flags: &enum iwl_fw_dbg_trigger_flags
  */
 struct iwl_fw_dbg_trigger_tlv {
 	__le32 id;
@@ -666,7 +675,8 @@ struct iwl_fw_dbg_trigger_tlv {
 	u8 start_conf_id;
 	__le16 occurrences;
 	__le16 trig_dis_ms;
-	__le16 reserved[3];
+	u8 flags;
+	u8 reserved[5];
 
 	u8 data[0];
 } __packed;
-- 
2.16.2

  reply	other threads:[~2018-03-28 19:54 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 14:11 [PATCH 00/14] iwlwifi: updates intended for v4.17 2018-03-28 Luca Coelho
2018-03-28 14:11 ` [PATCH 01/14] iwlwifi: mvm: flip AMSDU addresses only for 9000 family Luca Coelho
2018-03-28 14:11 ` [PATCH 02/14] iwlwifi: mvm: take RCU lock before dereferencing Luca Coelho
2018-03-28 14:11 ` [PATCH 03/14] iwlwifi: mvm: move TSO segment to a separate function Luca Coelho
2018-03-28 14:11 ` [PATCH 04/14] iwlwifi: set default timstamp marker cmd Luca Coelho
2018-03-28 14:11 ` [PATCH 05/14] iwlwifi: mvm: check if mac80211_queue is valid in iwl_mvm_disable_txq Luca Coelho
2018-03-28 14:25 ` [PATCH 06/14] iwlwifi: mvm: add adaptive dwell support Luca Coelho
2018-03-28 16:18   ` Kalle Valo
2018-03-28 19:33     ` Luciano Coelho
2018-03-28 19:52   ` [PATCH v2 " Luca Coelho
2018-03-28 19:54     ` Luca Coelho [this message]
2018-03-28 14:25 ` [PATCH 07/14] iwlwifi: mvm: add support for oce Luca Coelho
2018-03-28 16:20   ` Kalle Valo
2018-03-28 19:44     ` Luciano Coelho
2018-03-29  7:20       ` Kalle Valo
2018-03-28 19:53   ` [PATCH v2 " Luca Coelho
2018-03-28 14:25 ` [PATCH 08/14] iwlwifi: mvm: Allow iwl_mvm_mac_mgd_prepare_tx() when associated Luca Coelho
2018-03-28 14:26 ` [PATCH 09/14] iwlwifi: fw api: support the new scan request FW API version Luca Coelho
2018-03-28 14:26 ` [PATCH 10/14] iwlwifi: add a bunch of new 9000 PCI IDs Luca Coelho
2018-03-28 14:26 ` [PATCH 11/14] iwlwifi: api: Add geographic profile information to MCC_UPDATE_CMD Luca Coelho
2018-03-28 14:27 ` [PATCH 12/14] iwlwifi: bump the max API version for 9000 and 22000 devices Luca Coelho
2018-03-28 14:27 ` [PATCH 13/14] iwlwifi: mvm: save low latency causes in an enum Luca Coelho
2018-03-28 14:27 ` [PATCH 14/14] iwlwifi: wrt: add fw force restart via triggers Luca Coelho
2018-03-28 16:23   ` Kalle Valo
2018-03-28 19:46     ` Luciano Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180328195420.24737-1-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=shahar.s.matityahu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.