diff --git a/drivers/video/fbdev/msm/mdss_mdp_intf_writeback.c b/drivers/video/fbdev/msm/mdss_mdp_intf_writeback.c index e819ffcebd25..9e961694fef5 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_intf_writeback.c +++ b/drivers/video/fbdev/msm/mdss_mdp_intf_writeback.c @@ -650,6 +650,7 @@ static int mdss_mdp_wb_wait4comp(struct mdss_mdp_ctl *ctl, void *arg) struct mdss_mdp_writeback_ctx *ctx; int rc = 0; u64 rot_time; + u32 status, mask, isr; ctx = (struct mdss_mdp_writeback_ctx *) ctl->priv_data; if (!ctx) { @@ -666,14 +667,36 @@ static int mdss_mdp_wb_wait4comp(struct mdss_mdp_ctl *ctl, void *arg) NULL, NULL); if (rc == 0) { - mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_TIMEOUT); - rc = -ENODEV; - WARN(1, "writeback kickoff timed out (%d) ctl=%d\n", - rc, ctl->num); + mask = BIT(ctx->intr_type + ctx->intf_num); + + isr = readl_relaxed(ctl->mdata->mdp_base + + MDSS_MDP_REG_INTR_STATUS); + status = mask & isr; + + pr_info_once("mask: 0x%x, isr: 0x%x, status: 0x%x\n", + mask, isr, status); + + if (status) { + pr_warn_once("wb done but irq not triggered\n"); + mdss_mdp_irq_clear(ctl->mdata, + ctx->intr_type, + ctx->intf_num); + + mdss_mdp_writeback_intr_done(ctl); + rc = 0; + } else { + mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_TIMEOUT); + rc = -ENODEV; + WARN(1, "writeback kickoff timed out (%d) ctl=%d\n", + rc, ctl->num); + } } else { + rc = 0; + } + + if (rc == 0) { ctx->end_time = ktime_get(); mdss_mdp_ctl_notify(ctl, MDP_NOTIFY_FRAME_DONE); - rc = 0; } /* once operation is done, disable traffic shaper */