Commit 029c25f3 authored by Shahar S Matityahu's avatar Shahar S Matityahu Committed by Luca Coelho

iwlwifi: dbg_ini: fix debug monitor stop and restart in ini mode

In ini debug mode the recording does not restart unless legacy monitor
configuration is also given.

Add dbg_ini_dest field to trans to indicate the debug monitor
destination to solve this.
Signed-off-by: default avatarShahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent d374f315
...@@ -2381,11 +2381,7 @@ static void iwl_fw_dbg_collect_sync(struct iwl_fw_runtime *fwrt, u8 wk_idx) ...@@ -2381,11 +2381,7 @@ static void iwl_fw_dbg_collect_sync(struct iwl_fw_runtime *fwrt, u8 wk_idx)
iwl_fw_error_dump(fwrt); iwl_fw_error_dump(fwrt);
IWL_DEBUG_FW_INFO(fwrt, "WRT: data collection done\n"); IWL_DEBUG_FW_INFO(fwrt, "WRT: data collection done\n");
/* start recording again if the firmware is not crashed */ iwl_fw_dbg_restart_recording(fwrt, &params);
if (!test_bit(STATUS_FW_ERROR, &fwrt->trans->status) &&
fwrt->fw->dbg.dest_tlv) {
iwl_fw_dbg_restart_recording(fwrt, &params);
}
out: out:
clear_bit(wk_idx, &fwrt->dump.active_wks); clear_bit(wk_idx, &fwrt->dump.active_wks);
...@@ -2516,6 +2512,17 @@ static void iwl_fw_dbg_buffer_apply(struct iwl_fw_runtime *fwrt, ...@@ -2516,6 +2512,17 @@ static void iwl_fw_dbg_buffer_apply(struct iwl_fw_runtime *fwrt,
int block_idx = trans->dbg.num_blocks; int block_idx = trans->dbg.num_blocks;
u32 buf_location = le32_to_cpu(alloc->tlv.buffer_location); u32 buf_location = le32_to_cpu(alloc->tlv.buffer_location);
if (fwrt->trans->dbg.ini_dest == IWL_FW_INI_LOCATION_INVALID)
fwrt->trans->dbg.ini_dest = buf_location;
if (buf_location != fwrt->trans->dbg.ini_dest) {
WARN(fwrt,
"WRT: attempt to override buffer location on apply point %d\n",
pnt);
return;
}
if (buf_location == IWL_FW_INI_LOCATION_SRAM_PATH) { if (buf_location == IWL_FW_INI_LOCATION_SRAM_PATH) {
IWL_DEBUG_FW(trans, "WRT: applying SMEM buffer destination\n"); IWL_DEBUG_FW(trans, "WRT: applying SMEM buffer destination\n");
/* set sram monitor by enabling bit 7 */ /* set sram monitor by enabling bit 7 */
...@@ -2832,6 +2839,8 @@ static void iwl_fw_dbg_ini_reset_cfg(struct iwl_fw_runtime *fwrt) ...@@ -2832,6 +2839,8 @@ static void iwl_fw_dbg_ini_reset_cfg(struct iwl_fw_runtime *fwrt)
sizeof(fwrt->dump.internal_dbg_cfg_name)); sizeof(fwrt->dump.internal_dbg_cfg_name));
memset(fwrt->dump.external_dbg_cfg_name, 0, memset(fwrt->dump.external_dbg_cfg_name, 0,
sizeof(fwrt->dump.external_dbg_cfg_name)); sizeof(fwrt->dump.external_dbg_cfg_name));
fwrt->trans->dbg.ini_dest = IWL_FW_INI_LOCATION_INVALID;
} }
void iwl_fw_dbg_apply_point(struct iwl_fw_runtime *fwrt, void iwl_fw_dbg_apply_point(struct iwl_fw_runtime *fwrt,
......
...@@ -309,6 +309,14 @@ static inline void ...@@ -309,6 +309,14 @@ static inline void
iwl_fw_dbg_stop_recording(struct iwl_fw_runtime *fwrt, iwl_fw_dbg_stop_recording(struct iwl_fw_runtime *fwrt,
struct iwl_fw_dbg_params *params) struct iwl_fw_dbg_params *params)
{ {
/* if the FW crashed or not debug monitor cfg was given, there is
* no point in stopping
*/
if (test_bit(STATUS_FW_ERROR, &fwrt->trans->status) ||
(!fwrt->trans->dbg.dest_tlv &&
fwrt->trans->dbg.ini_dest == IWL_FW_INI_LOCATION_INVALID))
return;
if (fwrt->trans->cfg->device_family < IWL_DEVICE_FAMILY_22560) if (fwrt->trans->cfg->device_family < IWL_DEVICE_FAMILY_22560)
_iwl_fw_dbg_stop_recording(fwrt->trans, params); _iwl_fw_dbg_stop_recording(fwrt->trans, params);
else else
...@@ -335,7 +343,9 @@ _iwl_fw_dbg_restart_recording(struct iwl_trans *trans, ...@@ -335,7 +343,9 @@ _iwl_fw_dbg_restart_recording(struct iwl_trans *trans,
#ifdef CONFIG_IWLWIFI_DEBUGFS #ifdef CONFIG_IWLWIFI_DEBUGFS
static inline void iwl_fw_set_dbg_rec_on(struct iwl_fw_runtime *fwrt) static inline void iwl_fw_set_dbg_rec_on(struct iwl_fw_runtime *fwrt)
{ {
if (fwrt->fw->dbg.dest_tlv && fwrt->cur_fw_img == IWL_UCODE_REGULAR) if (fwrt->cur_fw_img == IWL_UCODE_REGULAR &&
(fwrt->fw->dbg.dest_tlv ||
fwrt->trans->dbg.ini_dest != IWL_FW_INI_LOCATION_INVALID))
fwrt->trans->dbg.rec_on = true; fwrt->trans->dbg.rec_on = true;
} }
#endif #endif
...@@ -344,6 +354,14 @@ static inline void ...@@ -344,6 +354,14 @@ static inline void
iwl_fw_dbg_restart_recording(struct iwl_fw_runtime *fwrt, iwl_fw_dbg_restart_recording(struct iwl_fw_runtime *fwrt,
struct iwl_fw_dbg_params *params) struct iwl_fw_dbg_params *params)
{ {
/* if the FW crashed or not debug monitor cfg was given, there is
* no point in restarting
*/
if (test_bit(STATUS_FW_ERROR, &fwrt->trans->status) ||
(!fwrt->trans->dbg.dest_tlv &&
fwrt->trans->dbg.ini_dest == IWL_FW_INI_LOCATION_INVALID))
return;
if (fwrt->trans->cfg->device_family < IWL_DEVICE_FAMILY_22560) if (fwrt->trans->cfg->device_family < IWL_DEVICE_FAMILY_22560)
_iwl_fw_dbg_restart_recording(fwrt->trans, params); _iwl_fw_dbg_restart_recording(fwrt->trans, params);
else else
......
...@@ -738,6 +738,7 @@ struct iwl_self_init_dram { ...@@ -738,6 +738,7 @@ struct iwl_self_init_dram {
* @num_blocks: number of blocks in fw_mon * @num_blocks: number of blocks in fw_mon
* @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
*/ */
struct iwl_trans_debug { struct iwl_trans_debug {
u8 n_dest_reg; u8 n_dest_reg;
...@@ -761,6 +762,7 @@ struct iwl_trans_debug { ...@@ -761,6 +762,7 @@ struct iwl_trans_debug {
struct iwl_dram_data fw_mon[IWL_FW_INI_APPLY_NUM]; struct iwl_dram_data fw_mon[IWL_FW_INI_APPLY_NUM];
bool hw_error; bool hw_error;
enum iwl_fw_ini_buffer_location ini_dest;
}; };
/** /**
......
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