Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19ad3480 authored by Sowmya Pandiri's avatar Sowmya Pandiri
Browse files

msm: vidc: Add debugfs support to debug timeout issues



This change asserts in the kernel whenever vidc driver times out
waiting for command completion from firmware. This will help to
debug such timeout issues.

Debug timeout can be enabled using the following debugfs
handle - /d/msm_vidc/debug_timeout

Change-Id: I218597f8b5ad0cb89c621f01132bcb669983df2b
Signed-off-by: default avatarSowmya Pandiri <spandiri@codeaurora.org>
parent 31f8dcc9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -636,6 +636,7 @@ static int wait_for_sess_signal_receipt(struct msm_vidc_inst *inst,
		dprintk(VIDC_ERR, "Wait interrupted or timed out: %d\n",
				SESSION_MSG_INDEX(cmd));
		msm_comm_kill_session(inst);
		BUG_ON(msm_vidc_debug_timeout);
		rc = -EIO;
	} else {
		rc = 0;
@@ -2034,6 +2035,7 @@ static int msm_comm_session_abort(struct msm_vidc_inst *inst)
		dprintk(VIDC_ERR,
				"%s: Wait interrupted or timed out [%p]: %d\n",
				__func__, inst, abort_completion);
		BUG_ON(msm_vidc_debug_timeout);
		rc = -EBUSY;
	} else {
		rc = 0;
@@ -2117,6 +2119,7 @@ int msm_comm_check_core_init(struct msm_vidc_core *core)
	if (!rc) {
		dprintk(VIDC_ERR, "%s: Wait interrupted or timed out: %d\n",
				__func__, SYS_MSG_INDEX(HAL_SYS_INIT_DONE));
		BUG_ON(msm_vidc_debug_timeout);
		rc = -EIO;
		goto exit;
	} else {
@@ -3623,6 +3626,7 @@ int msm_comm_try_get_prop(struct msm_vidc_inst *inst, enum hal_property ptype,
			SESSION_MSG_INDEX(HAL_SESSION_PROPERTY_INFO));
		inst->state = MSM_VIDC_CORE_INVALID;
		msm_comm_kill_session(inst);
		BUG_ON(msm_vidc_debug_timeout);
		rc = -ETIMEDOUT;
		goto exit;
	} else {
+4 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ int msm_vidc_sys_idle_indicator = 0;
int msm_vidc_firmware_unload_delay = 15000;
int msm_vidc_thermal_mitigation_disabled = 0;
int msm_vidc_bitrate_clock_scaling = 1;
int msm_vidc_debug_timeout = 0;

#define MAX_DBG_BUF_SIZE 4096

@@ -176,7 +177,9 @@ struct dentry *msm_vidc_debugfs_init_drv(void)
	__debugfs_create(bool, "disable_thermal_mitigation",
			&msm_vidc_thermal_mitigation_disabled) &&
	__debugfs_create(bool, "bitrate_clock_scaling",
			&msm_vidc_bitrate_clock_scaling);
			&msm_vidc_bitrate_clock_scaling) &&
	__debugfs_create(bool, "debug_timeout",
			&msm_vidc_debug_timeout);

#undef __debugfs_create

+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ extern int msm_vidc_sys_idle_indicator;
extern int msm_vidc_firmware_unload_delay;
extern int msm_vidc_thermal_mitigation_disabled;
extern int msm_vidc_bitrate_clock_scaling;
extern int msm_vidc_debug_timeout;

#define VIDC_MSG_PRIO2STRING(__level) ({ \
	char *__str; \
+1 −0
Original line number Diff line number Diff line
@@ -3363,6 +3363,7 @@ static int __prepare_pc(struct venus_hfi_device *device)
				"Wait interrupted or timeout for PC_PREP_DONE: %d\n",
				rc);
		__flush_debug_queue(device, NULL);
		BUG_ON(msm_vidc_debug_timeout);
		rc = -EIO;
		goto err_pc_prep;
	}