aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhilash Kumar <krabhi@codeaurora.org>2018-11-21 18:46:54 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2019-01-29 02:45:18 -0800
commitadeff6776ed5b9de633d40961b07ad88867d3119 (patch)
tree5a0015b095ca4bdc587110a94be8ab04d5ed229a
parent60f9160e1d849fc1065cfdb4f1dad641fe543859 (diff)
msm: camera: cdm: Avoid presence of stale tags in BL_FIFOLA.UM.6.8.1.r2-01200-QCS605.0
There is a possibility that some bl_tag might remain in the bl_list used by the KMD for BL_FIFO representation. This can cause timeout failures for init packet if the stale entry gets matched with the newly assigned tag. To avoid this, call the cdm_callback for all the entries in the list till we reach the one gen_irq was received for. As the BL_FIFO works in FIFO fashion, no next IRQ will get triggered before the first entry is done with. Change-Id: I4d9640cd4e655f421d4fd1390efde819258caf30 Signed-off-by: Abhilash Kumar <krabhi@codeaurora.org> Signed-off-by: Chandan Gera <cgera@codeaurora.org>
-rw-r--r--drivers/media/platform/msm/camera/cam_cdm/cam_cdm_hw_core.c28
-rw-r--r--drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c12
2 files changed, 19 insertions, 21 deletions
diff --git a/drivers/media/platform/msm/camera/cam_cdm/cam_cdm_hw_core.c b/drivers/media/platform/msm/camera/cam_cdm/cam_cdm_hw_core.c
index 4ae2f0a3bee2..6d0e85af1f9b 100644
--- a/drivers/media/platform/msm/camera/cam_cdm/cam_cdm_hw_core.c
+++ b/drivers/media/platform/msm/camera/cam_cdm/cam_cdm_hw_core.c
@@ -509,8 +509,8 @@ int cam_hw_cdm_submit_bl(struct cam_hw_info *cdm_hw,
if (!rc) {
CAM_DBG(CAM_CDM,
- "write BL success for cnt=%d with tag=%d",
- i, core->bl_tag);
+ "write BL success for cnt=%d with tag=%d total_cnt=%d",
+ i, core->bl_tag, req->data->cmd_arrary_count);
CAM_DBG(CAM_CDM, "Now commit the BL");
if (cam_hw_cdm_commit_bl_write(cdm_hw)) {
@@ -550,35 +550,33 @@ static void cam_hw_cdm_work(struct work_struct *work)
cdm_hw = payload->hw;
core = (struct cam_cdm *)cdm_hw->core_info;
- CAM_DBG(CAM_CDM, "IRQ status=%x", payload->irq_status);
+ CAM_DBG(CAM_CDM, "IRQ status=0x%x", payload->irq_status);
if (payload->irq_status &
CAM_CDM_IRQ_STATUS_INFO_INLINE_IRQ_MASK) {
- struct cam_cdm_bl_cb_request_entry *node;
+ struct cam_cdm_bl_cb_request_entry *node, *tnode;
- CAM_DBG(CAM_CDM, "inline IRQ data=%x",
+ CAM_DBG(CAM_CDM, "inline IRQ data=0x%x",
payload->irq_data);
mutex_lock(&cdm_hw->hw_mutex);
- node = cam_cdm_find_request_by_bl_tag(
- payload->irq_data,
- &core->bl_request_list);
- if (node) {
+ list_for_each_entry_safe(node, tnode,
+ &core->bl_request_list, entry) {
if (node->request_type ==
CAM_HW_CDM_BL_CB_CLIENT) {
cam_cdm_notify_clients(cdm_hw,
CAM_CDM_CB_STATUS_BL_SUCCESS,
(void *)node);
} else if (node->request_type ==
- CAM_HW_CDM_BL_CB_INTERNAL) {
+ CAM_HW_CDM_BL_CB_INTERNAL) {
CAM_ERR(CAM_CDM,
"Invalid node=%pK %d", node,
node->request_type);
}
list_del_init(&node->entry);
+ if (node->bl_tag == payload->irq_data) {
+ kfree(node);
+ break;
+ }
kfree(node);
- } else {
- CAM_ERR(CAM_CDM,
- "Inval node, inline_irq st=%x data=%x",
- payload->irq_status, payload->irq_data);
}
mutex_unlock(&cdm_hw->hw_mutex);
}
@@ -684,7 +682,7 @@ irqreturn_t cam_hw_cdm_irq(int irq_num, void *data)
CAM_ERR(CAM_CDM, "Failed to Write CDM HW IRQ cmd");
work_status = queue_work(cdm_core->work_queue, &payload->work);
if (work_status == false) {
- CAM_ERR(CAM_CDM, "Failed to queue work for irq=%x",
+ CAM_ERR(CAM_CDM, "Failed to queue work for irq=0x%x",
payload->irq_status);
kfree(payload);
}
diff --git a/drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c b/drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c
index ae678efb6846..730864424a8e 100644
--- a/drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c
+++ b/drivers/media/platform/msm/camera/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c
@@ -1470,8 +1470,8 @@ void cam_ife_cam_cdm_callback(uint32_t handle, void *userdata,
if (status == CAM_CDM_CB_STATUS_BL_SUCCESS) {
complete(&ctx->config_done_complete);
CAM_DBG(CAM_ISP,
- "Called by CDM hdl=%x, udata=%pK, status=%d, cookie=%llu",
- handle, userdata, status, cookie);
+ "Called by CDM hdl=%x, udata=%pK, status=%d, cookie=%llu ctx_index=%d",
+ handle, userdata, status, cookie, ctx->ctx_index);
} else {
CAM_WARN(CAM_ISP,
"Called by CDM hdl=%x, udata=%pK, status=%d, cookie=%llu",
@@ -1786,15 +1786,15 @@ static int cam_ife_mgr_config_hw(void *hw_mgr_priv,
msecs_to_jiffies(30));
if (rc <= 0) {
CAM_ERR(CAM_ISP,
- "config done completion timeout for req_id=%llu rc = %d",
- cfg->request_id, rc);
+ "config done completion timeout for req_id=%llu rc=%d ctx_index %d",
+ cfg->request_id, rc, ctx->ctx_index);
if (rc == 0)
rc = -ETIMEDOUT;
} else {
rc = 0;
CAM_DBG(CAM_ISP,
- "config done Success for req_id=%llu",
- cfg->request_id);
+ "config done Success for req_id=%llu ctx_index %d",
+ cfg->request_id, ctx->ctx_index);
}
}
} else {