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

Commit 4b9528e8 authored by Abhilash Kumar's avatar Abhilash Kumar
Browse files

msm: camera: core: Avoid spinlock recusion



The context's spinlock is shared between ioctl's and
tasklet. There is a possibility that while holding a
spinlock a tasklet gets scheduled on the same core.
This can cause spinlock recursion as the variants of
spin_lock used are different.
To fix this use spin_lock_bh instead of spin_lock.

Change-Id: I882e40d6c5da349da8b828cd6b2806828e1ea0a6
Signed-off-by: default avatarAbhilash Kumar <krabhi@codeaurora.org>
parent 65532007
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ static void cam_node_print_ctx_state(
	for (i = 0; i < node->ctx_size; i++) {
		ctx = &node->ctx_list[i];

		spin_lock(&ctx->lock);
		spin_lock_bh(&ctx->lock);
		CAM_INFO(CAM_CORE,
			"[%s][%d] : state=%d, refcount=%d, active_req_list=%d, pending_req_list=%d, wait_req_list=%d, free_req_list=%d",
			ctx->dev_name ? ctx->dev_name : "null",
@@ -41,7 +41,7 @@ static void cam_node_print_ctx_state(
			list_empty(&ctx->pending_req_list),
			list_empty(&ctx->wait_req_list),
			list_empty(&ctx->free_req_list));
		spin_unlock(&ctx->lock);
		spin_unlock_bh(&ctx->lock);
	}
	mutex_unlock(&node->list_mutex);
}