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

Commit 8e57cad2 authored by Sivan Reinstein's avatar Sivan Reinstein
Browse files

msm: ipa: invalidate uC requested command after completion



This change invalidates the command that is being sent to
IPA uC once a completion is received (whether it's in polling or
interrupt mode). This is done in order to prevent unnecessary calls
for the completion object of the IPA uC after a response has
already been received by polling (As the interrupt is fired in
any case).

Change-Id: Ifa7531324e9c9a6b2e0714f6e043d56eb534c4b8
Acked-by: default avatarDavid Arinzon <darinzon@qti.qualcomm.com>
Signed-off-by: default avatarSivan Reinstein <sivanr@codeaurora.org>
parent d4bc64ea
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -568,9 +568,11 @@ int ipa_uc_send_cmd(u32 cmd, u32 opcode, u32 expected_status,
				uc_rsp.raw32b = ipa_ctx->uc_ctx.uc_sram_mmio->
						responseParams;
				if (uc_rsp.params.originalCmdOp ==
				    ipa_ctx->uc_ctx.pending_cmd)
				    ipa_ctx->uc_ctx.pending_cmd) {
					ipa_ctx->uc_ctx.pending_cmd = -1;
					break;
				}
			}
			usleep_range(IPA_UC_POLL_SLEEP_USEC,
					IPA_UC_POLL_SLEEP_USEC);
		}
@@ -604,10 +606,12 @@ int ipa_uc_send_cmd(u32 cmd, u32 opcode, u32 expected_status,
	if (ipa_ctx->uc_ctx.uc_status != expected_status) {
		IPAERR("Recevied status %u, Expected status %u\n",
			ipa_ctx->uc_ctx.uc_status, expected_status);
		ipa_ctx->uc_ctx.pending_cmd = -1;
		mutex_unlock(&ipa_ctx->uc_ctx.uc_lock);
		return -EFAULT;
	}

	ipa_ctx->uc_ctx.pending_cmd = -1;
	mutex_unlock(&ipa_ctx->uc_ctx.uc_lock);

	IPADBG("uC cmd %u send succeeded\n", opcode);