浏览代码

msm: camera: cci: Add back mutex on cci

there should be a race condition on rd_done
read/write between cam_cci_irq and
cam_cci_read_bytes, add mutex to avoid.

CRs-Fixed: 2786609
Change-Id: Ic55976133bfdc7958b4b3c8b0efdf896f82e7ccf
Signed-off-by: chengxue <[email protected]>
chengxue 4 年之前
父节点
当前提交
6b90e92888
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/cam_sensor_module/cam_cci/cam_cci_core.c

+ 2 - 0
drivers/cam_sensor_module/cam_cci/cam_cci_core.c

@@ -1725,8 +1725,10 @@ static int32_t cam_cci_read_bytes(struct v4l2_subdev *sd,
 	 * THRESHOLD irq's, we reinit the threshold wait before
 	 * THRESHOLD irq's, we reinit the threshold wait before
 	 * we load the burst read cmd.
 	 * we load the burst read cmd.
 	 */
 	 */
+	mutex_lock(&cci_dev->cci_master_info[master].mutex_q[QUEUE_1]);
 	reinit_completion(&cci_dev->cci_master_info[master].rd_done);
 	reinit_completion(&cci_dev->cci_master_info[master].rd_done);
 	reinit_completion(&cci_dev->cci_master_info[master].th_complete);
 	reinit_completion(&cci_dev->cci_master_info[master].th_complete);
+	mutex_unlock(&cci_dev->cci_master_info[master].mutex_q[QUEUE_1]);
 
 
 	CAM_DBG(CAM_CCI, "Bytes to read %u", read_bytes);
 	CAM_DBG(CAM_CCI, "Bytes to read %u", read_bytes);
 	do {
 	do {