Kaynağa Gözat

msm: camera: isp: Add mutex while disabling rx

Disbaling RX in CSID during flush is not inside mutex lock.
This can result in damaging the lists and variables causing
stability issues.
This commit moves this call inside mutex lock. Also, a warn log
is added to inform if the flush call times out.

CRs-Fixed: 2974631
Change-Id: I50082c03bebacc4a11f826bdb318c52dbf5400e7
Signed-off-by: Gaurav Jindal <[email protected]>
Gaurav Jindal 4 yıl önce
ebeveyn
işleme
eab943de93

+ 5 - 5
drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c

@@ -3600,10 +3600,10 @@ static int cam_ife_csid_ver2_enable_hw(
 	if (csid_hw->top_err_irq_handle < 1) {
 		CAM_ERR(CAM_ISP, "csid[%d] top error irq subscribe fail",
 			csid_hw->hw_intf->hw_idx);
-		 cam_irq_controller_unsubscribe_irq(
+		cam_irq_controller_unsubscribe_irq(
 			csid_hw->csid_irq_controller,
-			csid_hw->top_err_irq_handle);
-		 csid_hw->top_err_irq_handle = 0;
+			csid_hw->buf_done_irq_handle);
+		csid_hw->buf_done_irq_handle = 0;
 		return -EINVAL;
 	}
 
@@ -3912,11 +3912,11 @@ int cam_ife_csid_ver2_stop(void *hw_priv,
 		rc = cam_irq_controller_unsubscribe_irq(
 			csid_hw->csid_irq_controller,
 			csid_hw->top_err_irq_handle);
-		csid_hw->buf_done_irq_handle = 0;
+		csid_hw->top_err_irq_handle = 0;
 	}
 
-	mutex_unlock(&csid_hw->hw_info->hw_mutex);
 	cam_ife_csid_ver2_disable_csi2(csid_hw);
+	mutex_unlock(&csid_hw->hw_info->hw_mutex);
 
 	reset.reset_type = CAM_IFE_CSID_RESET_PATH;
 	cam_ife_csid_ver2_reset(hw_priv, &reset,

+ 4 - 0
drivers/cam_req_mgr/cam_req_mgr_core.c

@@ -5044,6 +5044,10 @@ int cam_req_mgr_flush_requests(
 	rc = cam_common_wait_for_completion_timeout(
 		&link->workq_comp,
 		msecs_to_jiffies(CAM_REQ_MGR_SCHED_REQ_TIMEOUT));
+	if (rc)
+		CAM_WARN(CAM_CRM, "Flush call timeout for session_hdl %u link_hdl %u type: %d",
+			flush_info->link_hdl, flush_info->session_hdl,
+			flush_info->flush_type);
 end:
 	mutex_unlock(&g_crm_core_dev->crm_lock);
 	return rc;