Commit 3b589d56 authored by Shahar S Matityahu's avatar Shahar S Matityahu Committed by Luca Coelho

iwlwifi: dbg_ini: use new trigger TLV in dump flow

Make dump flow use the new trigger TLV.
Signed-off-by: default avatarShahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent c9fe75e9
...@@ -351,18 +351,37 @@ struct iwl_fw_ini_trigger { ...@@ -351,18 +351,37 @@ struct iwl_fw_ini_trigger {
} __packed; /* FW_TLV_DEBUG_TRIGGER_CONFIG_API_S_VER_1 */ } __packed; /* FW_TLV_DEBUG_TRIGGER_CONFIG_API_S_VER_1 */
/** /**
* struct iwl_fw_ini_trigger_tlv - (IWL_UCODE_TLV_TYPE_TRIGGERS) * struct iwl_fw_ini_trigger_tlv - trigger TLV
* Triggers that hold memory regions to dump in case a trigger fires
* *
* @header: header * Trigger that upon firing, determines what regions to collect
* @num_triggers: how many different triggers section and IDs are coming next *
* @trigger_config: list of trigger configurations * @hdr: debug header
* @time_point: time point. One of &enum iwl_fw_ini_time_point
* @trigger_reason: trigger reason
* @apply_policy: uses &enum iwl_fw_ini_trigger_apply_policy
* @dump_delay: delay from trigger fire to dump, in usec
* @occurrences: max trigger fire occurrences allowed
* @reserved: unused
* @ignore_consec: ignore consecutive triggers, in usec
* @reset_fw: if non zero, will reset and reload the FW
* @multi_dut: initiate debug dump data on several DUTs
* @regions_mask: mask of regions to collect
* @data: trigger data
*/ */
struct iwl_fw_ini_trigger_tlv { struct iwl_fw_ini_trigger_tlv {
struct iwl_fw_ini_header header; struct iwl_fw_ini_header hdr;
__le32 num_triggers; __le32 time_point;
struct iwl_fw_ini_trigger trigger_config[]; __le32 trigger_reason;
} __packed; /* FW_TLV_DEBUG_TRIGGERS_API_S_VER_1 */ __le32 apply_policy;
__le32 dump_delay;
__le32 occurrences;
__le32 reserved;
__le32 ignore_consec;
__le32 reset_fw;
__le32 multi_dut;
__le64 regions_mask;
__le32 data[];
} __packed; /* FW_TLV_DEBUG_TRIGGER_API_S_VER_1 */
#define IWL_FW_INI_MAX_IMG_NAME_LEN 32 #define IWL_FW_INI_MAX_IMG_NAME_LEN 32
#define IWL_FW_INI_MAX_DBG_CFG_NAME_LEN 64 #define IWL_FW_INI_MAX_DBG_CFG_NAME_LEN 64
......
This diff is collapsed.
...@@ -114,9 +114,8 @@ int iwl_fw_dbg_collect_desc(struct iwl_fw_runtime *fwrt, ...@@ -114,9 +114,8 @@ int iwl_fw_dbg_collect_desc(struct iwl_fw_runtime *fwrt,
bool monitor_only, unsigned int delay); bool monitor_only, unsigned int delay);
int iwl_fw_dbg_error_collect(struct iwl_fw_runtime *fwrt, int iwl_fw_dbg_error_collect(struct iwl_fw_runtime *fwrt,
enum iwl_fw_dbg_trigger trig_type); enum iwl_fw_dbg_trigger trig_type);
int _iwl_fw_dbg_ini_collect(struct iwl_fw_runtime *fwrt, int iwl_fw_dbg_ini_collect(struct iwl_fw_runtime *fwrt,
enum iwl_fw_ini_trigger_id id); struct iwl_fwrt_dump_data *dump_data);
int iwl_fw_dbg_ini_collect(struct iwl_fw_runtime *fwrt, u32 legacy_trigger_id);
int iwl_fw_dbg_collect(struct iwl_fw_runtime *fwrt, int iwl_fw_dbg_collect(struct iwl_fw_runtime *fwrt,
enum iwl_fw_dbg_trigger trig, const char *str, enum iwl_fw_dbg_trigger trig, const char *str,
size_t len, struct iwl_fw_dbg_trigger_tlv *trigger); size_t len, struct iwl_fw_dbg_trigger_tlv *trigger);
...@@ -222,29 +221,6 @@ _iwl_fw_dbg_trigger_on(struct iwl_fw_runtime *fwrt, ...@@ -222,29 +221,6 @@ _iwl_fw_dbg_trigger_on(struct iwl_fw_runtime *fwrt,
_iwl_fw_dbg_trigger_on((fwrt), (wdev), (id)); \ _iwl_fw_dbg_trigger_on((fwrt), (wdev), (id)); \
}) })
static inline bool
iwl_fw_ini_trigger_on(struct iwl_fw_runtime *fwrt,
enum iwl_fw_ini_trigger_id id)
{
struct iwl_fw_ini_trigger *trig;
u32 usec;
if (!iwl_trans_dbg_ini_valid(fwrt->trans) ||
id == IWL_FW_TRIGGER_ID_INVALID || id >= IWL_FW_TRIGGER_ID_NUM ||
!fwrt->dump.active_trigs[id].active)
return false;
trig = fwrt->dump.active_trigs[id].trig;
usec = le32_to_cpu(trig->ignore_consec);
if (iwl_fw_dbg_no_trig_window(fwrt, id, usec)) {
IWL_WARN(fwrt, "Trigger %d fired in no-collect window\n", id);
return false;
}
return true;
}
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,
...@@ -315,10 +291,8 @@ static inline void iwl_fw_flush_dumps(struct iwl_fw_runtime *fwrt) ...@@ -315,10 +291,8 @@ static inline void iwl_fw_flush_dumps(struct iwl_fw_runtime *fwrt)
int i; int i;
iwl_dbg_tlv_del_timers(fwrt->trans); iwl_dbg_tlv_del_timers(fwrt->trans);
for (i = 0; i < IWL_FW_RUNTIME_DUMP_WK_NUM; i++) { for (i = 0; i < IWL_FW_RUNTIME_DUMP_WK_NUM; i++)
flush_delayed_work(&fwrt->dump.wks[i].wk); flush_delayed_work(&fwrt->dump.wks[i].wk);
fwrt->dump.wks[i].ini_trig_id = IWL_FW_TRIGGER_ID_INVALID;
}
} }
#ifdef CONFIG_IWLWIFI_DEBUGFS #ifdef CONFIG_IWLWIFI_DEBUGFS
...@@ -381,12 +355,21 @@ static inline void iwl_fw_umac_set_alive_err_table(struct iwl_trans *trans, ...@@ -381,12 +355,21 @@ static inline void iwl_fw_umac_set_alive_err_table(struct iwl_trans *trans,
static inline void iwl_fw_error_collect(struct iwl_fw_runtime *fwrt) static inline void iwl_fw_error_collect(struct iwl_fw_runtime *fwrt)
{ {
if (iwl_trans_dbg_ini_valid(fwrt->trans) && fwrt->trans->dbg.hw_error) { enum iwl_fw_ini_time_point tp_id;
_iwl_fw_dbg_ini_collect(fwrt, IWL_FW_TRIGGER_ID_FW_HW_ERROR);
if (!iwl_trans_dbg_ini_valid(fwrt->trans)) {
iwl_fw_dbg_collect_desc(fwrt, &iwl_dump_desc_assert, false, 0);
return;
}
if (fwrt->trans->dbg.hw_error) {
tp_id = IWL_FW_INI_TIME_POINT_FW_HW_ERROR;
fwrt->trans->dbg.hw_error = false; fwrt->trans->dbg.hw_error = false;
} else { } else {
iwl_fw_dbg_collect_desc(fwrt, &iwl_dump_desc_assert, false, 0); tp_id = IWL_FW_INI_TIME_POINT_FW_ASSERT;
} }
iwl_dbg_tlv_time_point(fwrt, tp_id, NULL);
} }
void iwl_fw_error_print_fseq_regs(struct iwl_fw_runtime *fwrt); void iwl_fw_error_print_fseq_regs(struct iwl_fw_runtime *fwrt);
......
...@@ -381,10 +381,9 @@ struct iwl_fw_ini_error_dump_register { ...@@ -381,10 +381,9 @@ struct iwl_fw_ini_error_dump_register {
/* struct iwl_fw_ini_dump_info - ini dump information /* struct iwl_fw_ini_dump_info - ini dump information
* @version: dump version * @version: dump version
* @trigger_id: trigger id that caused the dump collection * @time_point: time point that caused the dump collection
* @trigger_reason: not supported yet * @trigger_reason: reason of the trigger
* @is_external_cfg: 1 if an external debug configuration was loaded * @external_cfg_state: &enum iwl_ini_cfg_state
* and 0 otherwise
* @ver_type: FW version type * @ver_type: FW version type
* @ver_subtype: FW version subype * @ver_subtype: FW version subype
* @hw_step: HW step * @hw_step: HW step
...@@ -410,9 +409,9 @@ struct iwl_fw_ini_error_dump_register { ...@@ -410,9 +409,9 @@ struct iwl_fw_ini_error_dump_register {
*/ */
struct iwl_fw_ini_dump_info { struct iwl_fw_ini_dump_info {
__le32 version; __le32 version;
__le32 trigger_id; __le32 time_point;
__le32 trigger_reason; __le32 trigger_reason;
__le32 is_external_cfg; __le32 external_cfg_state;
__le32 ver_type; __le32 ver_type;
__le32 ver_subtype; __le32 ver_subtype;
__le32 hw_step; __le32 hw_step;
......
...@@ -90,6 +90,27 @@ struct iwl_fwrt_shared_mem_cfg { ...@@ -90,6 +90,27 @@ struct iwl_fwrt_shared_mem_cfg {
#define IWL_FW_RUNTIME_DUMP_WK_NUM 5 #define IWL_FW_RUNTIME_DUMP_WK_NUM 5
/**
* struct iwl_fwrt_dump_data - dump data
* @trig: trigger the worker was scheduled upon
* @fw_pkt: packet received from FW
*/
struct iwl_fwrt_dump_data {
struct iwl_fw_ini_trigger_tlv *trig;
struct iwl_rx_packet *fw_pkt;
};
/**
* struct iwl_fwrt_wk_data - dump worker data struct
* @idx: index of the worker
* @wk: worker
*/
struct iwl_fwrt_wk_data {
u8 idx;
struct delayed_work wk;
struct iwl_fwrt_dump_data dump_data;
};
/** /**
* struct iwl_txf_iter_data - Tx fifo iterator data struct * struct iwl_txf_iter_data - Tx fifo iterator data struct
* @fifo: fifo number * @fifo: fifo number
...@@ -141,17 +162,13 @@ struct iwl_fw_runtime { ...@@ -141,17 +162,13 @@ struct iwl_fw_runtime {
struct { struct {
const struct iwl_fw_dump_desc *desc; const struct iwl_fw_dump_desc *desc;
bool monitor_only; bool monitor_only;
struct { struct iwl_fwrt_wk_data wks[IWL_FW_RUNTIME_DUMP_WK_NUM];
u8 idx;
enum iwl_fw_ini_trigger_id ini_trig_id;
struct delayed_work wk;
} wks[IWL_FW_RUNTIME_DUMP_WK_NUM];
unsigned long active_wks; unsigned long active_wks;
u8 conf; u8 conf;
/* ts of the beginning of a non-collect fw dbg data period */ /* ts of the beginning of a non-collect fw dbg data period */
unsigned long non_collect_ts_start[IWL_FW_TRIGGER_ID_NUM]; unsigned long non_collect_ts_start[IWL_FW_INI_TIME_POINT_NUM];
u32 *d3_debug_data; u32 *d3_debug_data;
struct iwl_fw_ini_region_cfg *active_regs[IWL_FW_INI_MAX_REGION_ID]; struct iwl_fw_ini_region_cfg *active_regs[IWL_FW_INI_MAX_REGION_ID];
struct iwl_fw_ini_active_triggers active_trigs[IWL_FW_TRIGGER_ID_NUM]; struct iwl_fw_ini_active_triggers active_trigs[IWL_FW_TRIGGER_ID_NUM];
......
...@@ -710,6 +710,7 @@ struct iwl_self_init_dram { ...@@ -710,6 +710,7 @@ struct iwl_self_init_dram {
* @fw_mon: address of the buffers for firmware monitor * @fw_mon: address of the buffers for firmware monitor
* @hw_error: equals true if hw error interrupt was received from the FW * @hw_error: equals true if hw error interrupt was received from the FW
* @ini_dest: debug monitor destination uses &enum iwl_fw_ini_buffer_location * @ini_dest: debug monitor destination uses &enum iwl_fw_ini_buffer_location
* @active_regions: active regions
*/ */
struct iwl_trans_debug { struct iwl_trans_debug {
u8 n_dest_reg; u8 n_dest_reg;
...@@ -731,6 +732,8 @@ struct iwl_trans_debug { ...@@ -731,6 +732,8 @@ struct iwl_trans_debug {
bool hw_error; bool hw_error;
enum iwl_fw_ini_buffer_location ini_dest; enum iwl_fw_ini_buffer_location ini_dest;
struct iwl_ucode_tlv *active_regions[IWL_FW_INI_MAX_REGION_ID];
}; };
/** /**
......
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