From 53152ba8cdb3313c3387a72c09af1d9aabd8964c Mon Sep 17 00:00:00 2001 From: Shivakumar Malke Date: Wed, 22 Feb 2023 17:30:09 +0530 Subject: [PATCH] msm: camera: ope: Avoid deadlock in OPE PF handling In OPE fault handler, while dumping pf info ctx_mutex is acquired and corresponding page fault ops is called. In pagefault ops same mutex is getting acquired again causing a dead lock. This commit avoids locking the same mutex again. CRs-Fixed: 3419490 Change-Id: I2e37f725865d091f2cb682fc62f5d21278b93959 Signed-off-by: Shivakumar Malke --- drivers/cam_ope/cam_ope_context.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/cam_ope/cam_ope_context.c b/drivers/cam_ope/cam_ope_context.c index c8be0da353d4..de93c02a0eab 100644 --- a/drivers/cam_ope/cam_ope_context.c +++ b/drivers/cam_ope/cam_ope_context.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -39,7 +40,6 @@ static int cam_ope_context_dump_active_request(void *data, return -EINVAL; } - mutex_lock(&ctx->ctx_mutex); if (ctx->state < CAM_CTX_ACQUIRED || ctx->state > CAM_CTX_ACTIVATED) { CAM_ERR(CAM_OPE, "Invalid state ope ctx %d state %d", ctx->ctx_id, ctx->state); @@ -65,7 +65,6 @@ static int cam_ope_context_dump_active_request(void *data, } end: - mutex_unlock(&ctx->ctx_mutex); return rc; }