Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c901963 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa: add a general function for assert"

parents e434f553 9b236aa1
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -2529,6 +2529,15 @@ void *ipa_get_ipc_logbuf_low(void)
}
EXPORT_SYMBOL(ipa_get_ipc_logbuf_low);

/**
 * ipa_assert() - general function for assertion
 */
void ipa_assert(void)
{
	pr_err("IPA: unrecoverable error has occurred, asserting\n");
	BUG();
}

static const struct dev_pm_ops ipa_pm_ops = {
	.suspend_noirq = ipa_ap_suspend,
	.resume_noirq = ipa_ap_resume,
+6 −0
Original line number Diff line number Diff line
@@ -97,6 +97,11 @@
		ipa_dec_client_disable_clks(&log_info); \
	} while (0)

#define ipa_assert_on(condition)\
do {\
	if (unlikely(condition))\
		ipa_assert();\
} while (0)

enum ipa_active_client_log_type {
	EP,
@@ -133,6 +138,7 @@ int ipa_set_required_perf_profile(enum ipa_voltage_level floor_voltage,
	u32 bandwidth_mbps);
void *ipa_get_ipc_logbuf(void);
void *ipa_get_ipc_logbuf_low(void);
void ipa_assert(void);


#endif /* _IPA_COMMON_I_H_ */
+9 −9
Original line number Diff line number Diff line
@@ -589,7 +589,7 @@ u16 ipahal_imm_cmd_get_opcode(enum ipahal_imm_cmd_name cmd)

	if (cmd >= IPA_IMM_CMD_MAX) {
		IPAHAL_ERR("Invalid immediate command imm_cmd=%u\n", cmd);
		BUG();
		ipa_assert();
		return -EFAULT;
	}

@@ -599,7 +599,7 @@ u16 ipahal_imm_cmd_get_opcode(enum ipahal_imm_cmd_name cmd)
	if (opcode == -1) {
		IPAHAL_ERR("Try to get opcode of obsolete IMM_CMD=%s\n",
			ipahal_imm_cmd_name_str(cmd));
		BUG();
		ipa_assert();
		return -EFAULT;
	}

@@ -622,7 +622,7 @@ u16 ipahal_imm_cmd_get_opcode_param(enum ipahal_imm_cmd_name cmd, int param)

	if (cmd >= IPA_IMM_CMD_MAX) {
		IPAHAL_ERR("Invalid immediate command IMM_CMD=%u\n", cmd);
		BUG();
		ipa_assert();
		return -EFAULT;
	}

@@ -632,7 +632,7 @@ u16 ipahal_imm_cmd_get_opcode_param(enum ipahal_imm_cmd_name cmd, int param)
	if (!ipahal_imm_cmd_objs[ipahal_ctx->hw_type][cmd].dyn_op) {
		IPAHAL_ERR("IMM_CMD=%s does not support dynamic opcode\n",
			ipahal_imm_cmd_name_str(cmd));
		BUG();
		ipa_assert();
		return -EFAULT;
	}

@@ -644,20 +644,20 @@ u16 ipahal_imm_cmd_get_opcode_param(enum ipahal_imm_cmd_name cmd, int param)
	if (param & ~0xFFFF) {
		IPAHAL_ERR("IMM_CMD=%s opcode param is invalid\n",
			ipahal_imm_cmd_name_str(cmd));
		BUG();
		ipa_assert();
		return -EFAULT;
	}
	opcode = ipahal_imm_cmd_objs[ipahal_ctx->hw_type][cmd].opcode;
	if (opcode == -1) {
		IPAHAL_ERR("Try to get opcode of obsolete IMM_CMD=%s\n",
			ipahal_imm_cmd_name_str(cmd));
		BUG();
		ipa_assert();
		return -EFAULT;
	}
	if (opcode & ~0xFFFF) {
		IPAHAL_ERR("IMM_CMD=%s opcode will be overridden\n",
			ipahal_imm_cmd_name_str(cmd));
		BUG();
		ipa_assert();
		return -EFAULT;
	}
	return (opcode + (param<<8));
@@ -674,13 +674,13 @@ struct ipahal_imm_cmd_pyld *ipahal_construct_imm_cmd(
{
	if (!params) {
		IPAHAL_ERR("Input error: params=%p\n", params);
		BUG();
		ipa_assert();
		return NULL;
	}

	if (cmd >= IPA_IMM_CMD_MAX) {
		IPAHAL_ERR("Invalid immediate command %u\n", cmd);
		BUG();
		ipa_assert();
		return NULL;
	}