From 5e5804282676c980b4dd496c192fbc1a1a4166b7 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 12 Oct 2023 21:36:17 +0200 Subject: [PATCH] dcp: Fix shutdown sequence on dptx errors Signed-off-by: Janne Grunau --- src/dcp.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/dcp.c b/src/dcp.c index b352ccba3..f0e873c8a 100644 --- a/src/dcp.c +++ b/src/dcp.c @@ -64,7 +64,6 @@ static int dcp_hdmi_dptx_init(dcp_dev_t *dcp, const display_config_t *cfg) dcp->dpav_ep = dcp_dpav_init(dcp); if (!dcp->dpav_ep) { printf("dcp: failed to initialize dpav endpoint\n"); - dcp_system_shutdown(dcp->system_ep); return -1; } @@ -72,7 +71,6 @@ static int dcp_hdmi_dptx_init(dcp_dev_t *dcp, const display_config_t *cfg) if (!dcp->dptx_ep) { printf("dcp: failed to initialize dptx-port endpoint\n"); dcp_dpav_shutdown(dcp->dpav_ep); - dcp_system_shutdown(dcp->system_ep); return -1; } @@ -81,6 +79,8 @@ static int dcp_hdmi_dptx_init(dcp_dev_t *dcp, const display_config_t *cfg) dcp->system_ep = dcp_system_init(dcp); if (!dcp->system_ep) { printf("dcp: failed to initialize system endpoint\n"); + dcp_dptx_shutdown(dcp->dptx_ep); + dcp_dpav_shutdown(dcp->dpav_ep); return -1; } @@ -187,8 +187,6 @@ dcp_dev_t *dcp_init(const display_config_t *cfg) out_afk: afk_epic_shutdown(dcp->afk); - rtkit_sleep(dcp->rtkit); - pmgr_reset(dcp_die, dcp_pmgr_dev); out_rtkit: rtkit_quiesce(dcp->rtkit); rtkit_free(dcp->rtkit); @@ -210,9 +208,9 @@ int dcp_shutdown(dcp_dev_t *dcp, bool sleep) sleep = false; } } + dcp_system_shutdown(dcp->system_ep); dcp_dptx_shutdown(dcp->dptx_ep); dcp_dpav_shutdown(dcp->dpav_ep); - dcp_system_shutdown(dcp->system_ep); free(dcp->phy); afk_epic_shutdown(dcp->afk); if (sleep) {