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

Commit e25d12eb authored by Abhilash Kumar's avatar Abhilash Kumar
Browse files

msm: camera: isp: Avoid cuncurrency between CRM operations



Camera context layer works on state machine principle that
allows events to drive state transition and operation based
on current state. Taking mutex_lock while processing the events
and operations will avoid any conflict because of scheduling
and state transitions.

Change-Id: I6042bb9bf6cb3b6eb1c2dcb6646cf0b353623971
Signed-off-by: default avatarAbhilash Kumar <krabhi@codeaurora.org>
parent 4593b601
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -172,6 +172,7 @@ int cam_context_handle_crm_apply_req(struct cam_context *ctx,
		return -EINVAL;
	}

	mutex_lock(&ctx->ctx_mutex);
	if (ctx->state_machine[ctx->state].crm_ops.apply_req) {
		rc = ctx->state_machine[ctx->state].crm_ops.apply_req(ctx,
			apply);
@@ -180,6 +181,7 @@ int cam_context_handle_crm_apply_req(struct cam_context *ctx,
			ctx->dev_hdl, ctx->state);
		rc = -EPROTO;
	}
	mutex_unlock(&ctx->ctx_mutex);

	return rc;
}