msm: vidc: BUG_ON before killing session on timeout

BUG_ON before killing session on timeout to ensure
firmware session state is maintained in ram dumps.

Change-Id: Ib011c7127675fae1040973a2085bde6283d5df1a
Signed-off-by: Surajit Podder <spodder@codeaurora.org>
This commit is contained in:
Surajit Podder 2017-02-07 12:20:10 +05:30 committed by Gerrit - the friendly Code Review server
parent 01e31721d2
commit 67ea5f664d

View file

@ -898,12 +898,12 @@ static int wait_for_sess_signal_receipt(struct msm_vidc_inst *inst,
if (!rc) { if (!rc) {
dprintk(VIDC_ERR, "Wait interrupted or timed out: %d\n", dprintk(VIDC_ERR, "Wait interrupted or timed out: %d\n",
SESSION_MSG_INDEX(cmd)); SESSION_MSG_INDEX(cmd));
msm_comm_kill_session(inst);
call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data); call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data);
dprintk(VIDC_ERR, dprintk(VIDC_ERR,
"sess resp timeout can potentially crash the system\n"); "sess resp timeout can potentially crash the system\n");
msm_comm_print_debug_info(inst); msm_comm_print_debug_info(inst);
BUG_ON(inst->core->resources.debug_timeout); BUG_ON(inst->core->resources.debug_timeout);
msm_comm_kill_session(inst);
rc = -EIO; rc = -EIO;
} else { } else {
rc = 0; rc = 0;
@ -4065,7 +4065,6 @@ int msm_comm_try_get_prop(struct msm_vidc_inst *inst, enum hal_property ptype,
__func__, inst, __func__, inst,
SESSION_MSG_INDEX(HAL_SESSION_PROPERTY_INFO)); SESSION_MSG_INDEX(HAL_SESSION_PROPERTY_INFO));
inst->state = MSM_VIDC_CORE_INVALID; inst->state = MSM_VIDC_CORE_INVALID;
msm_comm_kill_session(inst);
call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data); call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data);
dprintk(VIDC_ERR, dprintk(VIDC_ERR,
"SESS_PROP timeout can potentially crash the system\n"); "SESS_PROP timeout can potentially crash the system\n");
@ -4073,6 +4072,7 @@ int msm_comm_try_get_prop(struct msm_vidc_inst *inst, enum hal_property ptype,
msm_comm_print_debug_info(inst); msm_comm_print_debug_info(inst);
BUG_ON(inst->core->resources.debug_timeout); BUG_ON(inst->core->resources.debug_timeout);
msm_comm_kill_session(inst);
rc = -ETIMEDOUT; rc = -ETIMEDOUT;
goto exit; goto exit;
} else { } else {