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

Commit c4ebe94c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: cci: Add mutex_q lock for cci_init"

parents 79457f10 c0c8730b
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -51,6 +51,10 @@ int cam_cci_init(struct v4l2_subdev *sd,
		CAM_DBG(CAM_CCI, "master %d", master);
		if (master < MASTER_MAX && master >= 0) {
			mutex_lock(&cci_dev->cci_master_info[master].mutex);
			mutex_lock(&cci_dev->
				cci_master_info[master].mutex_q[QUEUE_0]);
			mutex_lock(&cci_dev->
				cci_master_info[master].mutex_q[QUEUE_1]);
			flush_workqueue(cci_dev->write_wq[master]);
			/* Re-initialize the completion */
			reinit_completion(
@@ -73,6 +77,10 @@ int cam_cci_init(struct v4l2_subdev *sd,
				CCI_TIMEOUT);
			if (rc <= 0)
				CAM_ERR(CAM_CCI, "wait failed %d", rc);
			mutex_unlock(&cci_dev->
				cci_master_info[master].mutex_q[QUEUE_1]);
			mutex_unlock(&cci_dev->
				cci_master_info[master].mutex_q[QUEUE_0]);
			mutex_unlock(&cci_dev->cci_master_info[master].mutex);
		}
		return 0;