msm: camera: cdm: check irq status on hang detection

Problem:
Check IRQ status on hang detection if the inline IRQ
is set then the cdm has triggered IRQ but there is a
workqueue scheduling delay which is causing the cdm's
config timeout.

Solution:
To prevent the timeout due to
scheduling delay check the work record and irq status
and return true if its delay.

CRs-Fixed: 3433175
Change-Id: Iaa34f8ff9b57e7da9f80677a7da9b4f9a53dad14
Signed-off-by: Yash Upadhyay <quic_yupadhya@quicinc.com>
This commit is contained in:
Yash Upadhyay 2023-03-14 21:38:14 +05:30
commit 9b3f91ecab

View file

@ -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");
@ -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,
@ -2831,24 +2833,19 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv,
CAM_DEFAULT_VALUE,
CAM_DEFAULT_VALUE, rc);
continue;
}
CAM_ERR(CAM_ISP,
"config done completion timeout for req_id=%llu rc=%d ctx_index %d",
cfg->request_id, rc,
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)
} else {
CAM_ERR(CAM_ISP,
"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);
rc = -ETIMEDOUT;
goto end;
break;
}
} else {
rc = 0;
CAM_DBG(CAM_ISP,
@ -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);