From 4be1de768e1b2d6f531912fb7922af341459d7db Mon Sep 17 00:00:00 2001 From: Huaibin Yang Date: Thu, 19 Feb 2015 16:54:23 -0800 Subject: [PATCH] msm: mdss: ignore overflow error when trigger BTA for video mode panel This overflow only happens once after device is out of phy reset state when BTA is triggered, however, data are still transmitted and BTA interrupt still returns, indicating that there is nothing wrong with data and panel. After the first overflow is ignored, there is no such error any more when s/w trigger more BTAs. Change-Id: Icb861e2232bda22f8fde008cf8e439594aef6732 Signed-off-by: Huaibin Yang --- drivers/video/fbdev/msm/mdss_dsi_host.c | 40 ++++++++++++++++++++----- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/drivers/video/fbdev/msm/mdss_dsi_host.c b/drivers/video/fbdev/msm/mdss_dsi_host.c index ee358004d10a..dcae9d1d5eed 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_host.c +++ b/drivers/video/fbdev/msm/mdss_dsi_host.c @@ -2238,6 +2238,16 @@ void mdss_dsi_ack_err_status(struct mdss_dsi_ctrl_pdata *ctrl) MIPI_OUTP(base + 0x0068, status); /* Writing of an extra 0 needed to clear error bits */ MIPI_OUTP(base + 0x0068, 0); + /* + * After bta done, h/w may have a fake overflow and + * that overflow may further cause ack_err about 3 ms + * later which is another false alarm. Here the + * warning message is ignored. + */ + if (ctrl->panel_data.panel_info.esd_check_enabled && + (ctrl->status_mode == ESD_BTA) && (status & 0x1008000)) + return; + pr_err("%s: status=%x\n", __func__, status); } } @@ -2368,6 +2378,29 @@ irqreturn_t mdss_dsi_isr(int irq, void *ptr) pr_debug("%s: ndx=%d isr=%x\n", __func__, ctrl->ndx, isr); + if (isr & DSI_INTR_BTA_DONE) { + spin_lock(&ctrl->mdp_lock); + mdss_dsi_disable_irq_nosync(ctrl, DSI_BTA_TERM); + complete(&ctrl->bta_comp); + /* + * When bta done happens, the panel should be in good + * state. However, bta could cause the fake overflow + * error for video mode. The similar issue happens when + * sending dcs cmd. This overflow further causes + * flicking because of phy reset which is unncessary, + * so here overflow error is ignored, and errors are + * cleared. + */ + if (ctrl->panel_data.panel_info.esd_check_enabled && + (ctrl->status_mode == ESD_BTA) && + (ctrl->panel_mode == DSI_VIDEO_MODE)) { + isr &= ~DSI_INTR_ERROR; + /* clear only overflow */ + mdss_dsi_set_reg(ctrl, 0x0c, 0x44440000, 0x44440000); + } + spin_unlock(&ctrl->mdp_lock); + } + if (isr & DSI_INTR_ERROR) { MDSS_XLOG(ctrl->ndx, ctrl->mdp_busy, isr, 0x97); mdss_dsi_error(ctrl); @@ -2403,13 +2436,6 @@ irqreturn_t mdss_dsi_isr(int irq, void *ptr) spin_unlock(&ctrl->mdp_lock); } - if (isr & DSI_INTR_BTA_DONE) { - spin_lock(&ctrl->mdp_lock); - mdss_dsi_disable_irq_nosync(ctrl, DSI_BTA_TERM); - complete(&ctrl->bta_comp); - spin_unlock(&ctrl->mdp_lock); - } - if (isr & DSI_INTR_DYNAMIC_REFRESH_DONE) { spin_lock(&ctrl->mdp_lock); mdss_dsi_disable_irq_nosync(ctrl, DSI_DYNAMIC_TERM);