Loading drivers/video/msm/mdss/mdss_dsi.c +27 −0 Original line number Diff line number Diff line Loading @@ -874,6 +874,11 @@ static int mdss_dsi_debugfs_setup(struct mdss_panel_data *pdata, DEBUGFS_CREATE_DCS_CMD("dsi_off_cmd", dfs->root, &dfs->off_cmd, ctrl_pdata->off_cmds); debugfs_create_u32("dsi_err_counter", 0644, dfs->root, &dfs_ctrl->err_cont.max_err_index); debugfs_create_u32("dsi_err_time_delta", 0644, dfs->root, &dfs_ctrl->err_cont.err_time_delta); dfs->override_flag = 0; dfs->ctrl_pdata = *ctrl_pdata; ctrl_pdata->debugfs_info = dfs; Loading Loading @@ -978,6 +983,8 @@ static void mdss_dsi_debugfsinfo_to_dsictrl_info( struct mdss_dsi_ctrl_pdata *ctrl_pdata) { struct mdss_dsi_debugfs_info *dfs = ctrl_pdata->debugfs_info; struct dsi_err_container *dfs_err_cont = &dfs->ctrl_pdata.err_cont; struct dsi_err_container *err_cont = &ctrl_pdata->err_cont; ctrl_pdata->cmd_sync_wait_broadcast = dfs->ctrl_pdata.cmd_sync_wait_broadcast; Loading @@ -991,6 +998,26 @@ static void mdss_dsi_debugfsinfo_to_dsictrl_info( dfs->ctrl_pdata.on_cmds.link_state; ctrl_pdata->off_cmds.link_state = dfs->ctrl_pdata.off_cmds.link_state; /* keep error counter between 2 to 10 */ if (dfs_err_cont->max_err_index >= 2 && dfs_err_cont->max_err_index <= MAX_ERR_INDEX) { err_cont->max_err_index = dfs_err_cont->max_err_index; } else { dfs_err_cont->max_err_index = err_cont->max_err_index; pr_warn("resetting the dsi error counter to %d\n", err_cont->max_err_index); } /* keep error duration between 16 ms to 100 seconds */ if (dfs_err_cont->err_time_delta >= 16 && dfs_err_cont->err_time_delta <= 100000) { err_cont->err_time_delta = dfs_err_cont->err_time_delta; } else { dfs_err_cont->err_time_delta = err_cont->err_time_delta; pr_warn("resetting the dsi error time delta to %d ms\n", err_cont->err_time_delta); } } static void mdss_dsi_validate_debugfs_info( Loading drivers/video/msm/mdss/mdss_dsi.h +15 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,8 @@ enum dsi_pm_type { #define DSI_DYNAMIC_REFRESH_PIPE_DELAY2 0x208 #define DSI_DYNAMIC_REFRESH_PLL_DELAY 0x20C #define MAX_ERR_INDEX 10 extern struct device dsi_dev; extern u32 dsi_irq; extern struct mdss_dsi_ctrl_pdata *ctrl_list[]; Loading Loading @@ -340,6 +342,17 @@ struct panel_horizontal_idle { int idle; }; struct dsi_err_container { u32 fifo_err_cnt; u32 phy_err_cnt; u32 err_cnt; u32 err_time_delta; u32 max_err_index; u32 index; s64 err_time[MAX_ERR_INDEX]; }; #define DSI_CTRL_LEFT DSI_CTRL_0 #define DSI_CTRL_RIGHT DSI_CTRL_1 #define DSI_CTRL_CLK_SLAVE DSI_CTRL_RIGHT Loading Loading @@ -492,6 +505,8 @@ struct mdss_dsi_ctrl_pdata { int m_vote_cnt; /* debugfs structure */ struct mdss_dsi_debugfs_info *debugfs_info; struct dsi_err_container err_cont; }; struct dsi_status_data { Loading drivers/video/msm/mdss/mdss_dsi_host.c +26 −1 Original line number Diff line number Diff line Loading @@ -114,7 +114,8 @@ void mdss_dsi_ctrl_init(struct device *ctrl_dev, mdss_dsi_buf_alloc(ctrl_dev, &ctrl->rx_buf, SZ_4K); mdss_dsi_buf_alloc(ctrl_dev, &ctrl->status_buf, SZ_4K); ctrl->cmdlist_commit = mdss_dsi_cmdlist_commit; ctrl->err_cont.err_time_delta = 100; ctrl->err_cont.max_err_index = MAX_ERR_INDEX; if (dsi_event.inited == 0) { kthread_run(dsi_event_thread, (void *)&dsi_event, Loading Loading @@ -2633,6 +2634,7 @@ void mdss_dsi_dln0_phy_err(struct mdss_dsi_ctrl_pdata *ctrl) if (status & 0x011111) { MIPI_OUTP(base + 0x00b4, status); pr_err("%s: status=%x\n", __func__, status); ctrl->err_cont.phy_err_cnt++; } } Loading @@ -2658,6 +2660,7 @@ void mdss_dsi_fifo_status(struct mdss_dsi_ctrl_pdata *ctrl) dsi_send_events(ctrl, DSI_EV_MDP_FIFO_UNDERFLOW, 0); if (status & 0x11110000) /* DLN_FIFO_EMPTY */ dsi_send_events(ctrl, DSI_EV_DSI_FIFO_EMPTY, 0); ctrl->err_cont.fifo_err_cnt++; } } Loading Loading @@ -2691,6 +2694,27 @@ void mdss_dsi_clk_status(struct mdss_dsi_ctrl_pdata *ctrl) } } static void __dsi_error_counter(struct dsi_err_container *err_container) { s64 prev_time, curr_time; int prev_index; err_container->err_cnt++; err_container->index = (err_container->index + 1) % err_container->max_err_index; curr_time = ktime_to_ms(ktime_get()); err_container->err_time[err_container->index] = curr_time; prev_index = (err_container->index + 1) % err_container->max_err_index; prev_time = err_container->err_time[prev_index]; if (prev_time && ((curr_time - prev_time) < err_container->err_time_delta)) MDSS_XLOG_TOUT_HANDLER("mdp", "dsi0_ctrl", "dsi0_phy", "dsi1_ctrl", "dsi1_phy", "panic"); } void mdss_dsi_error(struct mdss_dsi_ctrl_pdata *ctrl) { u32 intr; Loading @@ -2712,6 +2736,7 @@ void mdss_dsi_error(struct mdss_dsi_ctrl_pdata *ctrl) intr |= DSI_INTR_ERROR; MIPI_OUTP(ctrl->ctrl_base + 0x0110, intr); __dsi_error_counter(&ctrl->err_cont); dsi_send_events(ctrl, DSI_EV_MDP_BUSY_RELEASE, 0); } Loading Loading
drivers/video/msm/mdss/mdss_dsi.c +27 −0 Original line number Diff line number Diff line Loading @@ -874,6 +874,11 @@ static int mdss_dsi_debugfs_setup(struct mdss_panel_data *pdata, DEBUGFS_CREATE_DCS_CMD("dsi_off_cmd", dfs->root, &dfs->off_cmd, ctrl_pdata->off_cmds); debugfs_create_u32("dsi_err_counter", 0644, dfs->root, &dfs_ctrl->err_cont.max_err_index); debugfs_create_u32("dsi_err_time_delta", 0644, dfs->root, &dfs_ctrl->err_cont.err_time_delta); dfs->override_flag = 0; dfs->ctrl_pdata = *ctrl_pdata; ctrl_pdata->debugfs_info = dfs; Loading Loading @@ -978,6 +983,8 @@ static void mdss_dsi_debugfsinfo_to_dsictrl_info( struct mdss_dsi_ctrl_pdata *ctrl_pdata) { struct mdss_dsi_debugfs_info *dfs = ctrl_pdata->debugfs_info; struct dsi_err_container *dfs_err_cont = &dfs->ctrl_pdata.err_cont; struct dsi_err_container *err_cont = &ctrl_pdata->err_cont; ctrl_pdata->cmd_sync_wait_broadcast = dfs->ctrl_pdata.cmd_sync_wait_broadcast; Loading @@ -991,6 +998,26 @@ static void mdss_dsi_debugfsinfo_to_dsictrl_info( dfs->ctrl_pdata.on_cmds.link_state; ctrl_pdata->off_cmds.link_state = dfs->ctrl_pdata.off_cmds.link_state; /* keep error counter between 2 to 10 */ if (dfs_err_cont->max_err_index >= 2 && dfs_err_cont->max_err_index <= MAX_ERR_INDEX) { err_cont->max_err_index = dfs_err_cont->max_err_index; } else { dfs_err_cont->max_err_index = err_cont->max_err_index; pr_warn("resetting the dsi error counter to %d\n", err_cont->max_err_index); } /* keep error duration between 16 ms to 100 seconds */ if (dfs_err_cont->err_time_delta >= 16 && dfs_err_cont->err_time_delta <= 100000) { err_cont->err_time_delta = dfs_err_cont->err_time_delta; } else { dfs_err_cont->err_time_delta = err_cont->err_time_delta; pr_warn("resetting the dsi error time delta to %d ms\n", err_cont->err_time_delta); } } static void mdss_dsi_validate_debugfs_info( Loading
drivers/video/msm/mdss/mdss_dsi.h +15 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,8 @@ enum dsi_pm_type { #define DSI_DYNAMIC_REFRESH_PIPE_DELAY2 0x208 #define DSI_DYNAMIC_REFRESH_PLL_DELAY 0x20C #define MAX_ERR_INDEX 10 extern struct device dsi_dev; extern u32 dsi_irq; extern struct mdss_dsi_ctrl_pdata *ctrl_list[]; Loading Loading @@ -340,6 +342,17 @@ struct panel_horizontal_idle { int idle; }; struct dsi_err_container { u32 fifo_err_cnt; u32 phy_err_cnt; u32 err_cnt; u32 err_time_delta; u32 max_err_index; u32 index; s64 err_time[MAX_ERR_INDEX]; }; #define DSI_CTRL_LEFT DSI_CTRL_0 #define DSI_CTRL_RIGHT DSI_CTRL_1 #define DSI_CTRL_CLK_SLAVE DSI_CTRL_RIGHT Loading Loading @@ -492,6 +505,8 @@ struct mdss_dsi_ctrl_pdata { int m_vote_cnt; /* debugfs structure */ struct mdss_dsi_debugfs_info *debugfs_info; struct dsi_err_container err_cont; }; struct dsi_status_data { Loading
drivers/video/msm/mdss/mdss_dsi_host.c +26 −1 Original line number Diff line number Diff line Loading @@ -114,7 +114,8 @@ void mdss_dsi_ctrl_init(struct device *ctrl_dev, mdss_dsi_buf_alloc(ctrl_dev, &ctrl->rx_buf, SZ_4K); mdss_dsi_buf_alloc(ctrl_dev, &ctrl->status_buf, SZ_4K); ctrl->cmdlist_commit = mdss_dsi_cmdlist_commit; ctrl->err_cont.err_time_delta = 100; ctrl->err_cont.max_err_index = MAX_ERR_INDEX; if (dsi_event.inited == 0) { kthread_run(dsi_event_thread, (void *)&dsi_event, Loading Loading @@ -2633,6 +2634,7 @@ void mdss_dsi_dln0_phy_err(struct mdss_dsi_ctrl_pdata *ctrl) if (status & 0x011111) { MIPI_OUTP(base + 0x00b4, status); pr_err("%s: status=%x\n", __func__, status); ctrl->err_cont.phy_err_cnt++; } } Loading @@ -2658,6 +2660,7 @@ void mdss_dsi_fifo_status(struct mdss_dsi_ctrl_pdata *ctrl) dsi_send_events(ctrl, DSI_EV_MDP_FIFO_UNDERFLOW, 0); if (status & 0x11110000) /* DLN_FIFO_EMPTY */ dsi_send_events(ctrl, DSI_EV_DSI_FIFO_EMPTY, 0); ctrl->err_cont.fifo_err_cnt++; } } Loading Loading @@ -2691,6 +2694,27 @@ void mdss_dsi_clk_status(struct mdss_dsi_ctrl_pdata *ctrl) } } static void __dsi_error_counter(struct dsi_err_container *err_container) { s64 prev_time, curr_time; int prev_index; err_container->err_cnt++; err_container->index = (err_container->index + 1) % err_container->max_err_index; curr_time = ktime_to_ms(ktime_get()); err_container->err_time[err_container->index] = curr_time; prev_index = (err_container->index + 1) % err_container->max_err_index; prev_time = err_container->err_time[prev_index]; if (prev_time && ((curr_time - prev_time) < err_container->err_time_delta)) MDSS_XLOG_TOUT_HANDLER("mdp", "dsi0_ctrl", "dsi0_phy", "dsi1_ctrl", "dsi1_phy", "panic"); } void mdss_dsi_error(struct mdss_dsi_ctrl_pdata *ctrl) { u32 intr; Loading @@ -2712,6 +2736,7 @@ void mdss_dsi_error(struct mdss_dsi_ctrl_pdata *ctrl) intr |= DSI_INTR_ERROR; MIPI_OUTP(ctrl->ctrl_base + 0x0110, intr); __dsi_error_counter(&ctrl->err_cont); dsi_send_events(ctrl, DSI_EV_MDP_BUSY_RELEASE, 0); } Loading