From f4490c44a2cec00ed77d31b5b74fdc26da38069b Mon Sep 17 00:00:00 2001 From: Bang Nguyen Date: Wed, 31 Jul 2019 08:25:45 -0500 Subject: [PATCH] disp: msm: dsi: Raise BUG for continous panel recovery failure After the ESD detection and recovery keep trying to recover panel, but after 5 times, unsuccessfully recovery the panel, then cal BUG to reboot the phone. Port from: c3d7c03 Change-Id: I595027afdbb7934b63d2f41c151277a9c48b5e21 Signed-off-by: Bang Nguyen Reviewed-on: https://gerrit.mot.com/1697290 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Shuo Yan Reviewed-by: Guobin Zhang Submit-Approved: Jira Key --- msm/dsi/dsi_panel.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/msm/dsi/dsi_panel.c b/msm/dsi/dsi_panel.c index 6fc1b4e56031..b2c471d4d798 100644 --- a/msm/dsi/dsi_panel.c +++ b/msm/dsi/dsi_panel.c @@ -4829,6 +4829,7 @@ int dsi_panel_enable(struct dsi_panel *panel) { int rc = 0; u8 pwr_mode; + static int panel_recovery_retry; if (!panel) { DSI_ERR("Invalid params\n"); @@ -4856,9 +4857,19 @@ int dsi_panel_enable(struct dsi_panel *panel) if (pwr_mode != panel->disp_on_chk_val) { DSI_ERR("%s: Read Pwr_mode=0%x is not matched with expected value =0x%x\n", __func__, pwr_mode, panel->disp_on_chk_val); + + if (panel_recovery_retry++ > 5) { + DSI_ERR("%s: panel recovery failed for all retries", + __func__); + + BUG(); + } + dsi_panel_trigger_panel_dead_event(panel); - } else + } else { DSI_INFO("-. Pwr_mode(0x0A) = 0x%x\n", pwr_mode); + panel_recovery_retry = 0; + } } else DSI_INFO("-: no_panel_on_read_support is set\n");