Loading drivers/cam_cdm/cam_cdm.h +2 −4 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef _CAM_CDM_H_ Loading @@ -24,7 +24,7 @@ #define CAM_MAX_SW_CDM_VERSION_SUPPORTED 1 #define CAM_SW_CDM_INDEX 0 #define CAM_CDM_INFLIGHT_WORKS 5 #define CAM_CDM_INFLIGHT_WORKS 1 #define CAM_CDM_HW_RESET_TIMEOUT 300 /* Loading Loading @@ -69,8 +69,6 @@ #define CAM_CDM_BL_FIFO_LENGTH_MAX_DEFAULT 0x40 #define CAM_CDM_BL_FIFO_LENGTH_CFG_SHIFT 0x10 #define CAM_CDM_BL_FIFO_FLUSH_SHIFT 0x3 #define CAM_CDM_BL_FIFO_BOUNDARY_CHECK \ (CAM_CDM_BL_FIFO_LENGTH_MAX_DEFAULT / 2) #define CAM_CDM_BL_FIFO_REQ_SIZE_MAX 0x00 #define CAM_CDM_BL_FIFO_REQ_SIZE_MAX_DIV2 0x01 Loading drivers/cam_cdm/cam_cdm_hw_core.c +19 −23 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/delay.h> Loading Loading @@ -1264,9 +1264,6 @@ static void cam_hw_cdm_work(struct work_struct *work) list_for_each_entry_safe(node, tnode, &core->bl_fifo[fifo_idx].bl_request_list, entry) { if ((node->bl_tag <= payload->irq_data) || ((node->bl_tag - payload->irq_data) > CAM_CDM_BL_FIFO_BOUNDARY_CHECK)) { if (node->request_type == CAM_HW_CDM_BL_CB_CLIENT) { cam_cdm_notify_clients(cdm_hw, Loading @@ -1288,7 +1285,6 @@ static void cam_hw_cdm_work(struct work_struct *work) kfree(node); node = NULL; } } } else { CAM_INFO(CAM_CDM, "Skip GenIRQ, tag 0x%x fifo %d", Loading Loading @@ -2232,7 +2228,7 @@ static int cam_hw_cdm_component_bind(struct device *dev, sizeof(cdm_core->name)); snprintf(work_q_name + len, sizeof(work_q_name) - len, "%d", i); cdm_core->bl_fifo[i].work_queue = alloc_workqueue(work_q_name, WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS, WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS | WQ_HIGHPRI, CAM_CDM_INFLIGHT_WORKS); if (!cdm_core->bl_fifo[i].work_queue) { CAM_ERR(CAM_CDM, Loading drivers/cam_isp/isp_hw_mgr/cam_tfe_hw_mgr.c +19 −21 Original line number Diff line number Diff line Loading @@ -2648,6 +2648,7 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv, struct cam_tfe_hw_mgr_ctx *ctx; struct cam_isp_prepare_hw_update_data *hw_update_data; bool cdm_hang_detect = false; unsigned long rem_jiffies = 0; if (!hw_mgr_priv || !config_hw_args) { CAM_ERR(CAM_ISP, "Invalid arguments"); Loading Loading @@ -2814,12 +2815,13 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv, goto end; for (i = 0; i < CAM_TFE_HW_CONFIG_WAIT_MAX_TRY; i++) { rc = wait_for_completion_timeout( rem_jiffies = wait_for_completion_timeout( &ctx->config_done_complete, msecs_to_jiffies( CAM_TFE_HW_CONFIG_TIMEOUT)); if (rc <= 0) { if (!cam_cdm_detect_hang_error(ctx->cdm_handle)) { if (rem_jiffies <= 0) { rc = cam_cdm_detect_hang_error(ctx->cdm_handle); if (rc == 0) { CAM_ERR(CAM_ISP, "CDM workqueue delay detected, wait for some more time req_id=%llu rc=%d ctx_index %d", cfg->request_id, rc, Loading @@ -2831,24 +2833,19 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv, CAM_DEFAULT_VALUE, CAM_DEFAULT_VALUE, rc); continue; } } else { CAM_ERR(CAM_ISP, "config done completion timeout for req_id=%llu rc=%d ctx_index %d", cfg->request_id, rc, ctx->ctx_index); "config done completion timeout, cdm_hang=%d on req_id=%llu ctx_index %d", true, cfg->request_id, ctx->ctx_index); cam_req_mgr_debug_delay_detect(); trace_cam_delay_detect("ISP", "config done completion timeout", cfg->request_id, ctx->ctx_index, CAM_DEFAULT_VALUE, CAM_DEFAULT_VALUE, rc); if (rc == 0) rc = -ETIMEDOUT; goto end; break; } } else { rc = 0; CAM_DBG(CAM_ISP, Loading @@ -2859,7 +2856,8 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv, } if ((i == CAM_TFE_HW_CONFIG_WAIT_MAX_TRY) && (rc == 0)) rc = -ETIMEDOUT; CAM_DBG(CAM_ISP, "Wq delayed but IRQ CDM done"); end: CAM_DBG(CAM_ISP, "Exit: Config Done: %llu", cfg->request_id); Loading drivers/cam_ope/cam_ope_context.c +1 −2 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/debugfs.h> Loading Loading @@ -39,7 +40,6 @@ static int cam_ope_context_dump_active_request(void *data, return -EINVAL; } mutex_lock(&ctx->ctx_mutex); if (ctx->state < CAM_CTX_ACQUIRED || ctx->state > CAM_CTX_ACTIVATED) { CAM_ERR(CAM_OPE, "Invalid state ope ctx %d state %d", ctx->ctx_id, ctx->state); Loading @@ -65,7 +65,6 @@ static int cam_ope_context_dump_active_request(void *data, } end: mutex_unlock(&ctx->ctx_mutex); return rc; } Loading Loading
drivers/cam_cdm/cam_cdm.h +2 −4 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef _CAM_CDM_H_ Loading @@ -24,7 +24,7 @@ #define CAM_MAX_SW_CDM_VERSION_SUPPORTED 1 #define CAM_SW_CDM_INDEX 0 #define CAM_CDM_INFLIGHT_WORKS 5 #define CAM_CDM_INFLIGHT_WORKS 1 #define CAM_CDM_HW_RESET_TIMEOUT 300 /* Loading Loading @@ -69,8 +69,6 @@ #define CAM_CDM_BL_FIFO_LENGTH_MAX_DEFAULT 0x40 #define CAM_CDM_BL_FIFO_LENGTH_CFG_SHIFT 0x10 #define CAM_CDM_BL_FIFO_FLUSH_SHIFT 0x3 #define CAM_CDM_BL_FIFO_BOUNDARY_CHECK \ (CAM_CDM_BL_FIFO_LENGTH_MAX_DEFAULT / 2) #define CAM_CDM_BL_FIFO_REQ_SIZE_MAX 0x00 #define CAM_CDM_BL_FIFO_REQ_SIZE_MAX_DIV2 0x01 Loading
drivers/cam_cdm/cam_cdm_hw_core.c +19 −23 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/delay.h> Loading Loading @@ -1264,9 +1264,6 @@ static void cam_hw_cdm_work(struct work_struct *work) list_for_each_entry_safe(node, tnode, &core->bl_fifo[fifo_idx].bl_request_list, entry) { if ((node->bl_tag <= payload->irq_data) || ((node->bl_tag - payload->irq_data) > CAM_CDM_BL_FIFO_BOUNDARY_CHECK)) { if (node->request_type == CAM_HW_CDM_BL_CB_CLIENT) { cam_cdm_notify_clients(cdm_hw, Loading @@ -1288,7 +1285,6 @@ static void cam_hw_cdm_work(struct work_struct *work) kfree(node); node = NULL; } } } else { CAM_INFO(CAM_CDM, "Skip GenIRQ, tag 0x%x fifo %d", Loading Loading @@ -2232,7 +2228,7 @@ static int cam_hw_cdm_component_bind(struct device *dev, sizeof(cdm_core->name)); snprintf(work_q_name + len, sizeof(work_q_name) - len, "%d", i); cdm_core->bl_fifo[i].work_queue = alloc_workqueue(work_q_name, WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS, WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS | WQ_HIGHPRI, CAM_CDM_INFLIGHT_WORKS); if (!cdm_core->bl_fifo[i].work_queue) { CAM_ERR(CAM_CDM, Loading
drivers/cam_isp/isp_hw_mgr/cam_tfe_hw_mgr.c +19 −21 Original line number Diff line number Diff line Loading @@ -2648,6 +2648,7 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv, struct cam_tfe_hw_mgr_ctx *ctx; struct cam_isp_prepare_hw_update_data *hw_update_data; bool cdm_hang_detect = false; unsigned long rem_jiffies = 0; if (!hw_mgr_priv || !config_hw_args) { CAM_ERR(CAM_ISP, "Invalid arguments"); Loading Loading @@ -2814,12 +2815,13 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv, goto end; for (i = 0; i < CAM_TFE_HW_CONFIG_WAIT_MAX_TRY; i++) { rc = wait_for_completion_timeout( rem_jiffies = wait_for_completion_timeout( &ctx->config_done_complete, msecs_to_jiffies( CAM_TFE_HW_CONFIG_TIMEOUT)); if (rc <= 0) { if (!cam_cdm_detect_hang_error(ctx->cdm_handle)) { if (rem_jiffies <= 0) { rc = cam_cdm_detect_hang_error(ctx->cdm_handle); if (rc == 0) { CAM_ERR(CAM_ISP, "CDM workqueue delay detected, wait for some more time req_id=%llu rc=%d ctx_index %d", cfg->request_id, rc, Loading @@ -2831,24 +2833,19 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv, CAM_DEFAULT_VALUE, CAM_DEFAULT_VALUE, rc); continue; } } else { CAM_ERR(CAM_ISP, "config done completion timeout for req_id=%llu rc=%d ctx_index %d", cfg->request_id, rc, ctx->ctx_index); "config done completion timeout, cdm_hang=%d on req_id=%llu ctx_index %d", true, cfg->request_id, ctx->ctx_index); cam_req_mgr_debug_delay_detect(); trace_cam_delay_detect("ISP", "config done completion timeout", cfg->request_id, ctx->ctx_index, CAM_DEFAULT_VALUE, CAM_DEFAULT_VALUE, rc); if (rc == 0) rc = -ETIMEDOUT; goto end; break; } } else { rc = 0; CAM_DBG(CAM_ISP, Loading @@ -2859,7 +2856,8 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv, } if ((i == CAM_TFE_HW_CONFIG_WAIT_MAX_TRY) && (rc == 0)) rc = -ETIMEDOUT; CAM_DBG(CAM_ISP, "Wq delayed but IRQ CDM done"); end: CAM_DBG(CAM_ISP, "Exit: Config Done: %llu", cfg->request_id); Loading
drivers/cam_ope/cam_ope_context.c +1 −2 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/debugfs.h> Loading Loading @@ -39,7 +40,6 @@ static int cam_ope_context_dump_active_request(void *data, return -EINVAL; } mutex_lock(&ctx->ctx_mutex); if (ctx->state < CAM_CTX_ACQUIRED || ctx->state > CAM_CTX_ACTIVATED) { CAM_ERR(CAM_OPE, "Invalid state ope ctx %d state %d", ctx->ctx_id, ctx->state); Loading @@ -65,7 +65,6 @@ static int cam_ope_context_dump_active_request(void *data, } end: mutex_unlock(&ctx->ctx_mutex); return rc; } Loading