Explorar o código

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 %!s(int64=4) %!d(string=hai) anos
pai
achega
6b90e92888
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  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
 	 * 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].th_complete);
+	mutex_unlock(&cci_dev->cci_master_info[master].mutex_q[QUEUE_1]);
 
 	CAM_DBG(CAM_CCI, "Bytes to read %u", read_bytes);
 	do {