فهرست منبع

msm: camera: isp: Avoid race condition to prevent list corruption

in case of back-to-back bubble requests, We do internal recovery.
We don't have locks for list protection in the internal recovery flow.
From the core dump, we had seen that we were handling bubble in one core
but we had done list modification on another core during internal
recovery without list protection, which results in list corruption.
We are accessing the request queue during internal recovery without
any locks which are resulting in list corruption.
We need to use locks to prevent list corruption in the internal
recovery flow.

CRs-Fixed: 3444802
Change-Id: Id72077647795e51e112b030d4fb75d80299c1bed
Signed-off-by: Chandan Kumar Jha <[email protected]>
Chandan Kumar Jha 2 سال پیش
والد
کامیت
75a996d9a5
1فایلهای تغییر یافته به همراه5 افزوده شده و 0 حذف شده
  1. 5 0
      drivers/cam_isp/cam_isp_context.c

+ 5 - 0
drivers/cam_isp/cam_isp_context.c

@@ -3680,6 +3680,9 @@ static int __cam_isp_ctx_validate_for_req_reapply_util(
 	struct cam_isp_ctx_req *req_isp = NULL;
 	struct cam_isp_ctx_req *req_isp = NULL;
 	struct cam_context *ctx = ctx_isp->base;
 	struct cam_context *ctx = ctx_isp->base;
 
 
+	if (!in_interrupt())
+		spin_lock_bh(&ctx->lock);
+
 	/* Check for req in active/wait lists */
 	/* Check for req in active/wait lists */
 	if (list_empty(&ctx->active_req_list)) {
 	if (list_empty(&ctx->active_req_list)) {
 		CAM_DBG(CAM_ISP,
 		CAM_DBG(CAM_ISP,
@@ -3738,6 +3741,8 @@ static int __cam_isp_ctx_validate_for_req_reapply_util(
 	}
 	}
 
 
 end:
 end:
+	if (!in_interrupt())
+		spin_unlock_bh(&ctx->lock);
 	return rc;
 	return rc;
 }
 }