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

Commit 288d82e5 authored by Gaurav Jindal's avatar Gaurav Jindal
Browse files

msm: camera:icp: Fix deadlock during ICP pagefault handling



Pagefault handling is called with mutex protection from the cam-context.
Acquiring the mutex inside the ICP driver context causes recursive locking
and deadlock.
Remove the mutex lock during pagefault handling in ICP context.

Change-Id: I21a661112e7d00f3e2e01625124bb6b73cd5d5da
Signed-off-by: default avatarGaurav Jindal <gjindal@codeaurora.org>
parent 2c7016a5
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -45,12 +45,10 @@ static int cam_icp_context_dump_active_request(void *data, unsigned long iova,
		return -EINVAL;
	}

	mutex_lock(&ctx->ctx_mutex);

	if (ctx->state < CAM_CTX_ACQUIRED || ctx->state > CAM_CTX_ACTIVATED) {
		CAM_ERR(CAM_ICP, "Invalid state icp ctx %d state %d",
			ctx->ctx_id, ctx->state);
		goto end;
		return -EINVAL;
	}

	CAM_INFO(CAM_ICP, "iommu fault for icp ctx %d state %d",
@@ -71,8 +69,6 @@ static int cam_icp_context_dump_active_request(void *data, unsigned long iova,
				req->request_id, rc);
	}

end:
	mutex_unlock(&ctx->ctx_mutex);
	return rc;
}