Browse Source

video: driver: Increase FW timeout to 4sec for debug logging

Enabling debug logs in kernel driver can result in Linux
kernel thread scheduling issues which causes unpredictable
behavior. Therefore increased Hardware timeouts to 4sec
if debug logs are enabled i.e. logs are more than default
logs.

Change-Id: Ic0d04bc0a740c8b11c77574ad3252ca2fa0696bb
Signed-off-by: Vedang Nagar <[email protected]>
Vedang Nagar 2 năm trước cách đây
mục cha
commit
bf9dd01f97
2 tập tin đã thay đổi với 15 bổ sung8 xóa
  1. 8 2
      driver/vidc/inc/msm_vidc_debug.h
  2. 7 6
      driver/vidc/src/msm_vidc_debug.c

+ 8 - 2
driver/vidc/inc/msm_vidc_debug.h

@@ -78,8 +78,14 @@ enum vidc_msg_prio {
 	FW_PRINTK       = 0x10000000,
 	FW_FTRACE       = 0x20000000,
 };
-#define FW_LOGSHIFT    16
-#define FW_LOGMASK     0x0FFF0000
+
+#define DRV_LOG        (VIDC_ERR | VIDC_PRINTK)
+#define DRV_LOGSHIFT   (0)
+#define DRV_LOGMASK    (0x0FFF)
+
+#define FW_LOG         (FW_ERROR | FW_FATAL | FW_PRINTK)
+#define FW_LOGSHIFT    (16)
+#define FW_LOGMASK     (0x0FFF0000)
 
 #define dprintk_inst(__level, __level_str, inst, __fmt, ...) \
 	do { \

+ 7 - 6
driver/vidc/src/msm_vidc_debug.c

@@ -19,7 +19,7 @@ extern struct msm_vidc_core *g_core;
 #define MSM_VIDC_MIN_STATS_DELAY_MS     200
 #define MSM_VIDC_MAX_STATS_DELAY_MS     10000
 
-unsigned int msm_vidc_debug = VIDC_ERR | VIDC_PRINTK | FW_ERROR | FW_FATAL | FW_PRINTK;
+unsigned int msm_vidc_debug = (DRV_LOG | FW_LOG);
 
 static int debug_level_set(const char *val,
 	const struct kernel_param *kp)
@@ -45,11 +45,12 @@ static int debug_level_set(const char *val,
 
 	msm_vidc_debug = dvalue;
 
-	/* check only driver logmask */
-	if ((dvalue & 0xFF) > (VIDC_ERR | VIDC_HIGH)) {
-		core->capabilities[HW_RESPONSE_TIMEOUT].value = 2 * HW_RESPONSE_TIMEOUT_VALUE;
-		core->capabilities[SW_PC_DELAY].value         = 2 * SW_PC_DELAY_VALUE;
-		core->capabilities[FW_UNLOAD_DELAY].value     = 2 * FW_UNLOAD_DELAY_VALUE;
+	/* check if driver or FW logmask is more than default level */
+	if (((dvalue & DRV_LOGMASK) & ~(DRV_LOG)) ||
+		((dvalue & FW_LOGMASK) & ~(FW_LOG))) {
+		core->capabilities[HW_RESPONSE_TIMEOUT].value = 4 * HW_RESPONSE_TIMEOUT_VALUE;
+		core->capabilities[SW_PC_DELAY].value         = 4 * SW_PC_DELAY_VALUE;
+		core->capabilities[FW_UNLOAD_DELAY].value     = 4 * FW_UNLOAD_DELAY_VALUE;
 	} else {
 		/* reset timeout values, if user reduces the logging */
 		core->capabilities[HW_RESPONSE_TIMEOUT].value = HW_RESPONSE_TIMEOUT_VALUE;