From 9ce2d9e82a4daf5c2cf5548c335d666dc6e5fddd Mon Sep 17 00:00:00 2001 From: mingpan Date: Wed, 19 Oct 2022 16:37:53 +0800 Subject: [PATCH] msm: camera: cci: Make cci can be realesed when cci status is negative Make MSM_CCI_RELEASE command can be executed even if CCI status is negative. When IIC meets NACK error, CCI status will be set to negative state. But in function cam_cci_core_cfg, if CCI status is negative, then the command will not be executed, and the return value of function camera_io_release is never checked, so we do nothing even if cam_cci_release is not executed, if all MSM_CCI_INIT cmd is executed successfully but one or more MSM_CCI_RELEASE cmd is not executed, the streamon_clients of cpas will never be reduced to 0 and cpas will never be powered off. CRs-Fixed: 3316756 Change-Id: I7f3d8d4e604f5a41983f1419ccc8b5817b199740 Signed-off-by: mingpan --- drivers/cam_sensor_module/cam_cci/cam_cci_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cam_sensor_module/cam_cci/cam_cci_core.c b/drivers/cam_sensor_module/cam_cci/cam_cci_core.c index fcec47fca2..a0e7f56baf 100644 --- a/drivers/cam_sensor_module/cam_cci/cam_cci_core.c +++ b/drivers/cam_sensor_module/cam_cci/cam_cci_core.c @@ -1964,7 +1964,7 @@ int32_t cam_cci_core_cfg(struct v4l2_subdev *sd, return -EINVAL; } - if (cci_dev->cci_master_info[master].status < 0) { + if ((cci_dev->cci_master_info[master].status < 0) && (cci_ctrl->cmd != MSM_CCI_RELEASE)) { CAM_WARN(CAM_CCI, "CCI hardware is resetting"); return -EAGAIN; }