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

Commit d78d0cee authored by Jeyaprakash Soundrapandian's avatar Jeyaprakash Soundrapandian Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: icp: Keep the mutex locked when cleaning up" into dev/msm-4.9-camx

parents ce4a8d92 f25f1b7a
Loading
Loading
Loading
Loading
+6 −15
Original line number Original line Diff line number Diff line
@@ -2386,34 +2386,24 @@ static int cam_icp_mgr_hw_open(void *hw_mgr_priv, void *download_fw_args)
	}
	}
	a5_dev = (struct cam_hw_info *)a5_dev_intf->hw_priv;
	a5_dev = (struct cam_hw_info *)a5_dev_intf->hw_priv;
	rc = cam_icp_allocate_hfi_mem();
	rc = cam_icp_allocate_hfi_mem();
	if (rc) {
	if (rc)
		mutex_unlock(&hw_mgr->hw_mgr_mutex);
		goto alloc_hfi_mem_failed;
		goto alloc_hfi_mem_failed;
	}


	rc = cam_icp_mgr_device_init(hw_mgr);
	rc = cam_icp_mgr_device_init(hw_mgr);
	if (rc) {
	if (rc)
		mutex_unlock(&hw_mgr->hw_mgr_mutex);
		goto dev_init_fail;
		goto dev_init_fail;
	}


	rc = cam_icp_mgr_fw_download(hw_mgr);
	rc = cam_icp_mgr_fw_download(hw_mgr);
	if (rc) {
	if (rc)
		mutex_unlock(&hw_mgr->hw_mgr_mutex);
		goto fw_download_failed;
		goto fw_download_failed;
	}


	rc = cam_icp_mgr_hfi_init(hw_mgr);
	rc = cam_icp_mgr_hfi_init(hw_mgr);
	if (rc) {
	if (rc)
		mutex_unlock(&hw_mgr->hw_mgr_mutex);
		goto hfi_init_failed;
		goto hfi_init_failed;
	}


	rc = cam_icp_mgr_send_fw_init(hw_mgr);
	rc = cam_icp_mgr_send_fw_init(hw_mgr);
	if (rc) {
	if (rc)
		mutex_unlock(&hw_mgr->hw_mgr_mutex);
		goto fw_init_failed;
		goto fw_init_failed;
	}


	hw_mgr->ctxt_cnt = 0;
	hw_mgr->ctxt_cnt = 0;
	hw_mgr->fw_download = true;
	hw_mgr->fw_download = true;
@@ -2444,6 +2434,7 @@ static int cam_icp_mgr_hw_open(void *hw_mgr_priv, void *download_fw_args)
dev_init_fail:
dev_init_fail:
	cam_icp_free_hfi_mem();
	cam_icp_free_hfi_mem();
alloc_hfi_mem_failed:
alloc_hfi_mem_failed:
	mutex_unlock(&hw_mgr->hw_mgr_mutex);
	return rc;
	return rc;
}
}