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

Commit 77d5d77e authored by Prasad Sodagudi's avatar Prasad Sodagudi
Browse files

soc: qcom: Add trace points for tracking



Currently scm_call_start and scm_call_end traces
are not called in proper location for scm_call2 api,
as there is no need to track retry of scm_calls.
Also add scm_call tracing in scm_call2_atomic API too.

Change-Id: I158a59b3ca6bc8bd7fe52a6fbb779d1614cc26b7
Signed-off-by: default avatarPrasad Sodagudi <psodagud@codeaurora.org>
parent 10cc07ab
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -382,6 +382,7 @@ int scm_call2(u32 fn_id, struct scm_desc *desc)

	x0 = fn_id | scm_version_mask;

	trace_scm_call_start(x0, desc);
	do {
		mutex_lock(&scm_lock);

@@ -390,8 +391,6 @@ int scm_call2(u32 fn_id, struct scm_desc *desc)

		desc->ret[0] = desc->ret[1] = desc->ret[2] = 0;

		trace_scm_call_start(x0, desc);

		if (scm_version == SCM_ARMV8_64)
			ret = __scm_call_armv8_64(x0, desc->arginfo,
						  desc->args[0], desc->args[1],
@@ -405,8 +404,6 @@ int scm_call2(u32 fn_id, struct scm_desc *desc)
						  &desc->ret[0], &desc->ret[1],
						  &desc->ret[2]);

		trace_scm_call_end(desc);

		if (SCM_SVC_ID(fn_id) == SCM_SVC_LMH)
			mutex_unlock(&scm_lmh_lock);

@@ -418,6 +415,7 @@ int scm_call2(u32 fn_id, struct scm_desc *desc)
			pr_warn("scm: secure world has been busy for 1 second!\n");
	}  while (ret == SCM_V2_EBUSY && (retry_count++ < SCM_EBUSY_MAX_RETRY));

	trace_scm_call_end(desc);
	if (ret < 0)
		pr_err("scm_call failed: func id %#llx, ret: %d, syscall returns: %#llx, %#llx, %#llx\n",
			x0, ret, desc->ret[0], desc->ret[1], desc->ret[2]);
@@ -453,6 +451,7 @@ int scm_call2_atomic(u32 fn_id, struct scm_desc *desc)

	x0 = fn_id | BIT(SMC_ATOMIC_SYSCALL) | scm_version_mask;

	trace_scm_call_start(x0, desc);
	if (scm_version == SCM_ARMV8_64)
		ret = __scm_call_armv8_64(x0, desc->arginfo, desc->args[0],
					  desc->args[1], desc->args[2],
@@ -463,6 +462,7 @@ int scm_call2_atomic(u32 fn_id, struct scm_desc *desc)
					  desc->args[1], desc->args[2],
					  desc->x5, &desc->ret[0],
					  &desc->ret[1], &desc->ret[2]);
	trace_scm_call_end(desc);
	if (ret < 0)
		pr_err("scm_call failed: func id %#llx, ret: %d, syscall returns: %#llx, %#llx, %#llx\n",
			x0, ret, desc->ret[0],