[PATCH 15/51] drm/amd/display: Fixed kernel panic when booting with DP-to-HDMI dongle

sunpeng.li at amd.com sunpeng.li at amd.com
Mon Dec 2 17:33:29 UTC 2019

From: David Galiffi <David.Galiffi at amd.com>

In dc_link_is_dp_sink_present, if dal_ddc_open fails, then
dal_gpio_destroy_ddc is called, destroying pin_data and pin_clock. They
are created only on dc_construct, and next aux access will cause a panic.

Instead of calling dal_gpio_destroy_ddc, call dal_ddc_close.

Signed-off-by: David Galiffi <David.Galiffi at amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng at amd.com>
Acked-by: Leo Li <sunpeng.li at amd.com>
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index 4681ca20f683..cef8c1ba9797 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -372,7 +372,7 @@ bool dc_link_is_dp_sink_present(struct dc_link *link)
 	if (GPIO_RESULT_OK != dal_ddc_open(
-		dal_gpio_destroy_ddc(&ddc);
+		dal_ddc_close(ddc);
 		return present;

More information about the amd-gfx mailing list