Commit fc2fe0a5 authored by Gregory Greenman's avatar Gregory Greenman Committed by Johannes Berg
Browse files

wifi: iwlwifi: fw: disable firmware debug asserts



Disable firmware debug asserts, which are used for internal
firmware testing purposes only.

Signed-off-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230913145231.8feafd9b17be.Ia7bec82ac25897caab581692d67055aa1aca2ed2@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent c9331008
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -522,4 +522,26 @@ enum iwl_mvm_tas_statically_disabled_reason {
	TAS_DISABLED_REASON_MAX,
}; /*_TAS_STATICALLY_DISABLED_REASON_E*/

/**
 * enum iwl_fw_dbg_config_cmd_type - types of FW debug config command
 * @DEBUG_TOKEN_CONFIG_TYPE: token config type
 */
enum iwl_fw_dbg_config_cmd_type {
	DEBUG_TOKEN_CONFIG_TYPE = 0x2B,
}; /* LDBG_CFG_CMD_TYPE_API_E_VER_1 */

/* this token disables debug asserts in the firmware */
#define IWL_FW_DBG_CONFIG_TOKEN 0x00011301

/**
 * struct iwl_fw_dbg_config_cmd - configure FW debug
 *
 * @type: according to &enum iwl_fw_dbg_config_cmd_type
 * @conf: FW configuration
 */
struct iwl_fw_dbg_config_cmd {
	__le32 type;
	__le32 conf;
} __packed; /* LDBG_CFG_CMD_API_S_VER_7 */

#endif /* __iwl_fw_api_debug_h__ */
+25 −0
Original line number Diff line number Diff line
@@ -3228,3 +3228,28 @@ void iwl_fw_dbg_stop_restart_recording(struct iwl_fw_runtime *fwrt,
#endif
}
IWL_EXPORT_SYMBOL(iwl_fw_dbg_stop_restart_recording);

void iwl_fw_disable_dbg_asserts(struct iwl_fw_runtime *fwrt)
{
	struct iwl_fw_dbg_config_cmd cmd = {
		.type = cpu_to_le32(DEBUG_TOKEN_CONFIG_TYPE),
		.conf = cpu_to_le32(IWL_FW_DBG_CONFIG_TOKEN),
	};
	struct iwl_host_cmd hcmd = {
		.id = WIDE_ID(LONG_GROUP, LDBG_CONFIG_CMD),
		.data[0] = &cmd,
		.len[0] = sizeof(cmd),
	};
	u32 preset = u32_get_bits(fwrt->trans->dbg.domains_bitmap,
				  GENMASK(31, IWL_FW_DBG_DOMAIN_POS + 1));

	/* supported starting from 9000 devices */
	if (fwrt->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_9000)
		return;

	if (fwrt->trans->dbg.yoyo_bin_loaded || (preset && preset != 1))
		return;

	iwl_trans_send_cmd(fwrt->trans, &hcmd);
}
IWL_EXPORT_SYMBOL(iwl_fw_disable_dbg_asserts);
+1 −0
Original line number Diff line number Diff line
@@ -329,6 +329,7 @@ void iwl_fwrt_dump_error_logs(struct iwl_fw_runtime *fwrt);
void iwl_send_dbg_dump_complete_cmd(struct iwl_fw_runtime *fwrt,
				    u32 timepoint,
				    u32 timepoint_data);
void iwl_fw_disable_dbg_asserts(struct iwl_fw_runtime *fwrt);

#define IWL_FW_CHECK_FAILED(_obj, _fmt, ...)				\
	IWL_ERR_LIMIT(_obj, _fmt, __VA_ARGS__)
+2 −0
Original line number Diff line number Diff line
@@ -509,6 +509,8 @@ void iwl_dbg_tlv_load_bin(struct device *dev, struct iwl_trans *trans)
	if (res)
		return;

	trans->dbg.yoyo_bin_loaded = true;

	iwl_dbg_tlv_parse_bin(trans, fw->data, fw->size);

	release_firmware(fw);
+2 −0
Original line number Diff line number Diff line
@@ -839,6 +839,7 @@ struct iwl_pc_data {
 * @dump_file_name_ext_valid: dump file name extension if valid or not
 * @num_pc: number of program counter for cpu
 * @pc_data: details of the program counter
 * @yoyo_bin_loaded: tells if a yoyo debug file has been loaded
 */
struct iwl_trans_debug {
	u8 n_dest_reg;
@@ -880,6 +881,7 @@ struct iwl_trans_debug {
	bool dump_file_name_ext_valid;
	u32 num_pc;
	struct iwl_pc_data *pc_data;
	bool yoyo_bin_loaded;
};

struct iwl_dma_ptr {
Loading