Commit 46c7c982 authored by Shahar S Matityahu's avatar Shahar S Matityahu Committed by Luca Coelho

iwlwifi: dbg_ini: enable ignore consecutive trigger feature

Enable ignore consecutive trigger feature which allows to configure the
driver to skip consecutive triggers from the same type.
Signed-off-by: default avatarShahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 159133c8
...@@ -1484,8 +1484,7 @@ _iwl_fw_error_ini_dump(struct iwl_fw_runtime *fwrt, ...@@ -1484,8 +1484,7 @@ _iwl_fw_error_ini_dump(struct iwl_fw_runtime *fwrt,
if (id == FW_DBG_TRIGGER_FW_ASSERT) if (id == FW_DBG_TRIGGER_FW_ASSERT)
id = IWL_FW_TRIGGER_ID_FW_ASSERT; id = IWL_FW_TRIGGER_ID_FW_ASSERT;
if (WARN_ON(id >= ARRAY_SIZE(fwrt->dump.active_trigs)) || if (!iwl_fw_ini_trigger_on(fwrt, id))
!fwrt->dump.active_trigs[id].active)
return NULL; return NULL;
trigger = fwrt->dump.active_trigs[id].trig; trigger = fwrt->dump.active_trigs[id].trig;
......
...@@ -162,9 +162,9 @@ iwl_fw_dbg_trigger_stop_conf_match(struct iwl_fw_runtime *fwrt, ...@@ -162,9 +162,9 @@ iwl_fw_dbg_trigger_stop_conf_match(struct iwl_fw_runtime *fwrt,
} }
static inline bool static inline bool
iwl_fw_dbg_no_trig_window(struct iwl_fw_runtime *fwrt, u32 id, u32 dis_ms) iwl_fw_dbg_no_trig_window(struct iwl_fw_runtime *fwrt, u32 id, u32 dis_usec)
{ {
unsigned long wind_jiff = msecs_to_jiffies(dis_ms); unsigned long wind_jiff = usecs_to_jiffies(dis_usec);
/* If this is the first event checked, jump to update start ts */ /* If this is the first event checked, jump to update start ts */
if (fwrt->dump.non_collect_ts_start[id] && if (fwrt->dump.non_collect_ts_start[id] &&
...@@ -181,11 +181,12 @@ iwl_fw_dbg_trigger_check_stop(struct iwl_fw_runtime *fwrt, ...@@ -181,11 +181,12 @@ iwl_fw_dbg_trigger_check_stop(struct iwl_fw_runtime *fwrt,
struct wireless_dev *wdev, struct wireless_dev *wdev,
struct iwl_fw_dbg_trigger_tlv *trig) struct iwl_fw_dbg_trigger_tlv *trig)
{ {
u32 usec = le16_to_cpu(trig->trig_dis_ms) * USEC_PER_MSEC;
if (wdev && !iwl_fw_dbg_trigger_vif_match(trig, wdev)) if (wdev && !iwl_fw_dbg_trigger_vif_match(trig, wdev))
return false; return false;
if (iwl_fw_dbg_no_trig_window(fwrt, le32_to_cpu(trig->id), if (iwl_fw_dbg_no_trig_window(fwrt, le32_to_cpu(trig->id), usec)) {
le16_to_cpu(trig->trig_dis_ms))) {
IWL_WARN(fwrt, "Trigger %d occurred while no-collect window.\n", IWL_WARN(fwrt, "Trigger %d occurred while no-collect window.\n",
trig->id); trig->id);
return false; return false;
...@@ -222,24 +223,22 @@ _iwl_fw_dbg_trigger_on(struct iwl_fw_runtime *fwrt, ...@@ -222,24 +223,22 @@ _iwl_fw_dbg_trigger_on(struct iwl_fw_runtime *fwrt,
}) })
static inline bool static inline bool
_iwl_fw_ini_trigger_on(struct iwl_fw_runtime *fwrt, iwl_fw_ini_trigger_on(struct iwl_fw_runtime *fwrt,
const enum iwl_fw_dbg_trigger id) enum iwl_fw_ini_trigger_id id)
{ {
struct iwl_fw_ini_active_triggers *active = struct iwl_fw_ini_trigger *trig;
&fwrt->dump.active_trigs[id]; u32 usec;
u32 ms;
if (!fwrt->trans->ini_valid)
return false;
if (!active->active) if (!fwrt->trans->ini_valid || id >= IWL_FW_TRIGGER_ID_NUM ||
!fwrt->dump.active_trigs[id].active)
return false; return false;
ms = le32_to_cpu(active->trig->ignore_consec); trig = fwrt->dump.active_trigs[id].trig;
if (ms) usec = le32_to_cpu(trig->ignore_consec);
ms /= USEC_PER_MSEC;
if (iwl_fw_dbg_no_trig_window(fwrt, id, ms)) { if (iwl_fw_dbg_no_trig_window(fwrt, id, usec)) {
IWL_WARN(fwrt, "Trigger %d fired in no-collect window\n", id); IWL_WARN(fwrt, "Trigger %d fired in no-collect window\n", id);
return false; return false;
} }
...@@ -247,12 +246,6 @@ _iwl_fw_ini_trigger_on(struct iwl_fw_runtime *fwrt, ...@@ -247,12 +246,6 @@ _iwl_fw_ini_trigger_on(struct iwl_fw_runtime *fwrt,
return true; return true;
} }
#define iwl_fw_ini_trigger_on(fwrt, wdev, id) ({ \
BUILD_BUG_ON(!__builtin_constant_p(id)); \
BUILD_BUG_ON((id) >= IWL_FW_TRIGGER_ID_NUM); \
_iwl_fw_ini_trigger_on((fwrt), (wdev), (id)); \
})
static inline void static inline void
_iwl_fw_dbg_trigger_simple_stop(struct iwl_fw_runtime *fwrt, _iwl_fw_dbg_trigger_simple_stop(struct iwl_fw_runtime *fwrt,
struct wireless_dev *wdev, struct wireless_dev *wdev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment