Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b90e928 authored by chengxue's avatar chengxue
Browse files

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: default avatarchengxue <chengxue@codeaurora.org>
parent 4e9f4848
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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 {