diff options
| author | Abhinav Kumar <abhinavk@codeaurora.org> | 2019-04-24 12:30:58 -0700 |
|---|---|---|
| committer | Abhinav Kumar <abhinavk@codeaurora.org> | 2019-04-24 13:23:00 -0700 |
| commit | d3a9050f4f7f2797ea96e125df0a02ca84da40dc (patch) | |
| tree | 394064fb3a4795099a7d2d38c5df0f1e6b8e034b | |
| parent | 38d4aa7f02777b07d36b97e5abb822d0f85fcdb3 (diff) | |
msm: ext_disp: re-initialize hpd completion before signaling events
Currently the HPD completion is re-initialized after signaling
to the audio/display userspace. This can cause race conditions
and we could end up missing the acknowledgment from audio or
display userspace completely.
Re-initialize the HPD completion before signaling to the userspace.
Change-Id: I96d466b2114f87c3b86a202f270e0bd218465c34
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
| -rw-r--r-- | drivers/platform/msm/msm_ext_display.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/platform/msm/msm_ext_display.c b/drivers/platform/msm/msm_ext_display.c index bc15ef2a5b2b..f7ab59d5b773 100644 --- a/drivers/platform/msm/msm_ext_display.c +++ b/drivers/platform/msm/msm_ext_display.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -228,6 +228,8 @@ static int msm_ext_disp_process_display(struct msm_ext_disp *ext_disp, else ext_disp->current_disp = EXT_DISPLAY_TYPE_MAX; + reinit_completion(&ext_disp->hpd_comp); + ret = msm_ext_disp_send_cable_notification(ext_disp, state); /* positive ret value means audio node was switched */ @@ -237,7 +239,6 @@ static int msm_ext_disp_process_display(struct msm_ext_disp *ext_disp, goto end; } - reinit_completion(&ext_disp->hpd_comp); ret = wait_for_completion_timeout(&ext_disp->hpd_comp, HZ * 5); if (!ret) { pr_err("display timeout\n"); @@ -262,6 +263,8 @@ static int msm_ext_disp_process_audio(struct msm_ext_disp *ext_disp, goto end; } + reinit_completion(&ext_disp->hpd_comp); + ret = msm_ext_disp_send_audio_notification(ext_disp, state); /* positive ret value means audio node was switched */ @@ -271,7 +274,6 @@ static int msm_ext_disp_process_audio(struct msm_ext_disp *ext_disp, goto end; } - reinit_completion(&ext_disp->hpd_comp); ret = wait_for_completion_timeout(&ext_disp->hpd_comp, HZ * 2); if (!ret) { pr_err("audio timeout\n"); |
