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

Commit 41716fad authored by Alok Chauhan's avatar Alok Chauhan Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: req_mgr: Fix deadlock in ICP driver in close sequence



ICP driver is not releasing mutex in error scenario
in close sequence and causing deadlock further in open.

Fix the deadlock and avoid prints in other driver
while close in provider crash.

CRs-Fixed: 2938073
Change-Id: I226c9a8e9b2d0c30e90282b11fbd15ea0b085f87
Signed-off-by: default avatarAlok Chauhan <alokc@codeaurora.org>
parent 9f184635
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -107,8 +107,8 @@ int cam_icp_subdev_close_internal(struct v4l2_subdev *sd,

	mutex_lock(&g_icp_dev.icp_lock);
	if (g_icp_dev.open_cnt <= 0) {
		CAM_WARN(CAM_ICP, "ICP subdev is already closed");
		return 0;
		CAM_DBG(CAM_ICP, "ICP subdev is already closed");
		goto end;
	}
	g_icp_dev.open_cnt--;
	if (!node) {
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ static int cam_actuator_subdev_close(struct v4l2_subdev *sd,
	bool crm_active = cam_req_mgr_is_open(CAM_ACTUATOR);

	if (crm_active) {
		CAM_INFO(CAM_ACTUATOR,
		CAM_DBG(CAM_ACTUATOR,
			"CRM is ACTIVE, close should be from CRM");
		return 0;
	}
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ static int cam_csiphy_subdev_close(struct v4l2_subdev *sd,
	bool crm_active = cam_req_mgr_is_open(CAM_CSIPHY);

	if (crm_active) {
		CAM_INFO(CAM_CSIPHY, "CRM is ACTIVE, close should be from CRM");
		CAM_DBG(CAM_CSIPHY, "CRM is ACTIVE, close should be from CRM");
		return 0;
	}

+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ static int cam_eeprom_subdev_close(struct v4l2_subdev *sd,
	bool crm_active = cam_req_mgr_is_open(CAM_EEPROM);

	if (crm_active) {
		CAM_INFO(CAM_EEPROM, "CRM is ACTIVE, close should be from CRM");
		CAM_DBG(CAM_EEPROM, "CRM is ACTIVE, close should be from CRM");
		return 0;
	}

+1 −1
Original line number Diff line number Diff line
@@ -260,7 +260,7 @@ static int cam_flash_subdev_close(struct v4l2_subdev *sd,
	bool crm_active = cam_req_mgr_is_open(CAM_FLASH);

	if (crm_active) {
		CAM_INFO(CAM_FLASH, "CRM is ACTIVE, close should be from CRM");
		CAM_DBG(CAM_FLASH, "CRM is ACTIVE, close should be from CRM");
		return 0;
	}

Loading