All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/msm/dp: trigger unplug event in msm_dp_display_disable
@ 2021-01-28  2:17 ` Judy Hsiao
  0 siblings, 0 replies; 7+ messages in thread
From: Judy Hsiao @ 2021-01-28  2:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mark Brown, Taniya Das, Rohit kumar, Banajit Goswami,
	Patrick Lai, Andy Gross, Bjorn Andersson, Liam Girdwood,
	Rob Herring, Jaroslav Kysela, Takashi Iwai, Srini Kandagatla,
	Stephan Gerhold, dianders, dgreid, cychiang, tzungbi, swboyd,
	linux-arm-kernel, linux-arm-msm, devicetree, alsa-devel,
	Judy Hsiao, Judy Hsiao

1. Trigger the unplug event in msm_dp_display_disable() to shutdown
   audio properly.
2. Reset the completion before signal the disconnect event.

Signed-off-by: Judy Hsiao <judyhsiao@chromium.org>
---
 drivers/gpu/drm/msm/dp/dp_display.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index 3bc7ed21de286..81f6794a25100 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -651,8 +651,8 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data)
 	dp_add_event(dp, EV_DISCONNECT_PENDING_TIMEOUT, 0, DP_TIMEOUT_5_SECOND);
 
 	/* signal the disconnect event early to ensure proper teardown */
-	dp_display_handle_plugged_change(g_dp_display, false);
 	reinit_completion(&dp->audio_comp);
+	dp_display_handle_plugged_change(g_dp_display, false);
 
 	dp_catalog_hpd_config_intr(dp->catalog, DP_DP_HPD_PLUG_INT_MASK |
 					DP_DP_IRQ_HPD_INT_MASK, true);
@@ -890,6 +890,9 @@ static int dp_display_disable(struct dp_display_private *dp, u32 data)
 
 	/* wait only if audio was enabled */
 	if (dp_display->audio_enabled) {
+		/* signal the disconnect event */
+		reinit_completion(&dp->audio_comp);
+		dp_display_handle_plugged_change(dp_display, false);
 		if (!wait_for_completion_timeout(&dp->audio_comp,
 				HZ * 5))
 			DRM_ERROR("audio comp timeout\n");
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-01 20:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28  2:17 [PATCH] drm/msm/dp: trigger unplug event in msm_dp_display_disable Judy Hsiao
2021-01-28  2:17 ` Judy Hsiao
2021-01-28  2:17 ` Judy Hsiao
2021-01-28  8:30 ` Stephen Boyd
2021-01-28  8:30   ` Stephen Boyd
2021-01-28  8:30   ` Stephen Boyd
2021-03-01 19:59 ` patchwork-bot+linux-arm-msm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.