فهرست منبع

msm: camera: isp: Check for execution context prior to obtaining lock

Currently, in_interrupt() is used to determine task context.
in_interrupt() would return 0 if the execution is in task context;
a spin lock is obtained with bh disabled. Since the bh's are disabled,
the preempt count/soft_irq disable count would increase.
When we attempt to release the lock, the same in_interrupt() API
would now return non-zero, failing to release the lock.
The change uses appropriate preempt API to determine execution context.

CRs-Fixed: 3509317
Change-Id: I43f981bf3a2d4c238cebc4b29fa8a9aa0a8e0df3
Signed-off-by: Soumen Ghosh <[email protected]>
Soumen Ghosh 2 سال پیش
والد
کامیت
9e69478cf5
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      drivers/cam_isp/cam_isp_context.c

+ 2 - 2
drivers/cam_isp/cam_isp_context.c

@@ -3683,7 +3683,7 @@ static int __cam_isp_ctx_validate_for_req_reapply_util(
 	struct cam_isp_ctx_req *req_isp = NULL;
 	struct cam_context *ctx = ctx_isp->base;
 
-	if (!in_interrupt())
+	if (in_task())
 		spin_lock_bh(&ctx->lock);
 
 	/* Check for req in active/wait lists */
@@ -3744,7 +3744,7 @@ static int __cam_isp_ctx_validate_for_req_reapply_util(
 	}
 
 end:
-	if (!in_interrupt())
+	if (in_task())
 		spin_unlock_bh(&ctx->lock);
 	return rc;
 }