From ecaabfefc9ffe33a0d77c2aff395dfe7ba67a4b4 Mon Sep 17 00:00:00 2001 From: Rajkumar Subbiah Date: Fri, 26 Aug 2022 15:37:26 -0400 Subject: [PATCH] disp: msm: dp: resend hpd notification to usermode This change adds robustness to hpd notification by resending it if there was no action in 2 seconds, just in case, the first notification didn't make it to the usermode. Change-Id: Iaf00669ec77e8c50618ee5618735a98518ad7f1a Signed-off-by: Rajkumar Subbiah --- msm/dp/dp_display.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/msm/dp/dp_display.c b/msm/dp/dp_display.c index e723997e..fe073d4b 100644 --- a/msm/dp/dp_display.c +++ b/msm/dp/dp_display.c @@ -983,8 +983,18 @@ static int dp_display_send_hpd_notification(struct dp_display_private *dp, bool (!!dp_display_state_is(DP_STATE_ENABLED) == hpd)) goto skip_wait; - if (!wait_for_completion_timeout(&dp->notification_comp, - HZ * 5)) { + // wait 2 seconds + if (wait_for_completion_timeout(&dp->notification_comp, HZ * 2)) + goto skip_wait; + + //resend notification + if (dp->mst.mst_active) + dp->mst.cbs.hpd(&dp->dp_display, hpd); + else + dp_display_send_hpd_event(dp); + + // wait another 3 seconds + if (!wait_for_completion_timeout(&dp->notification_comp, HZ * 3)) { DP_WARN("%s timeout\n", hpd ? "connect" : "disconnect"); ret = -EINVAL; }