From: Alex Hung <alex.hung@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Harry Wentland <harry.wentland@amd.com>,
Leo Li <sunpeng.li@amd.com>,
Aurabindo Pillai <aurabindo.pillai@amd.com>,
Roman Li <roman.li@amd.com>, Wayne Lin <wayne.lin@amd.com>,
Tom Chung <chiahsuan.chung@amd.com>,
"Fangzhi Zuo" <jerry.zuo@amd.com>,
Dan Wheeler <daniel.wheeler@amd.com>, Ray Wu <Ray.Wu@amd.com>,
Ivan Lipski <ivan.lipski@amd.com>, Alex Hung <alex.hung@amd.com>,
James Lin <PingLei.Lin@amd.com>,
Chenyu Chen <Chen-Yu.Chen@amd.com>,
Mario Limonciello <mario.limonciello@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
<stable@vger.kernel.org>
Subject: [PATCH 08/28] drm/amd/display: Avoid closing unowned DDC pins
Date: Tue, 27 Oct 2026 17:17:04 -0600 [thread overview]
Message-ID: <20261027232005.2879750-9-alex.hung@amd.com> (raw)
In-Reply-To: <20261027232005.2879750-1-alex.hung@amd.com>
[WHY]
dal_ddc_open() cleans up pins it acquires on later failures. If the
data-pin open fails, this attempt acquired nothing. If opening the
clock pin or configuring fails, dal_ddc_open() closes the pins it
opened. An extra dal_ddc_close() is unnecessary and unsafe:
GPIO_RESULT_ALREADY_OPENED can mean AUX owns the existing handles,
and closing them here would disrupt AUX.
[HOW]
Remove the extra dal_ddc_close() from the failed-open path.
Cc: Jerry Zuo <jerry.zuo@amd.com>
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Hung <alex.hung@amd.com>
---
.../drm/amd/display/dc/link/protocols/link_dp_capability.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
index ad1a499b0d9d..c487c5b87dfd 100644
--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
+++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
@@ -2602,12 +2602,8 @@ bool dp_is_sink_present(struct dc_link *link)
* which indicates we need additional delay
*/
- if (dal_ddc_open(ddc, GPIO_MODE_INPUT,
- GPIO_DDC_CONFIG_TYPE_MODE_I2C) != GPIO_RESULT_OK) {
- dal_ddc_close(ddc);
-
+ if (dal_ddc_open(ddc, GPIO_MODE_INPUT, GPIO_DDC_CONFIG_TYPE_MODE_I2C) != GPIO_RESULT_OK)
return present;
- }
/*
* Read GPIO: DP sink is present if both clock and data pins are zero
--
2.53.0
next prev parent reply other threads:[~2026-10-27 23:22 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 23:16 [PATCH 00/28] DC Patches Oct 27, 2026 Alex Hung
2026-10-27 23:16 ` [PATCH 01/28] drm/amd/display: Use DCN6 driver_if for PPCLK_e enum Alex Hung
2026-10-27 23:16 ` [PATCH 02/28] drm/amd/display: Allow bypassing link_off_frame_count check for replay debug mode Alex Hung
2026-10-27 23:16 ` [PATCH 03/28] drm/amd/display: Clarify endianness error Alex Hung
2026-10-27 23:17 ` [PATCH 04/28] drm/amd/display: Add visual confirm full viewport debug option Alex Hung
2026-10-27 23:17 ` [PATCH 05/28] drm/amd/display: Remove DCN401 RDPCS PHY state reads Alex Hung
2026-10-27 23:17 ` [PATCH 06/28] drm/amd/display: Adjust DSC slice calc. policy Alex Hung
2026-10-27 23:17 ` [PATCH 07/28] drm/amd/display: Configure alternate-channel apertures Alex Hung
2026-10-27 23:17 ` Alex Hung [this message]
2026-10-27 23:17 ` [PATCH 09/28] drm/amd/display: Support replay frame update interval Alex Hung
2026-10-27 23:17 ` [PATCH 10/28] drm/amd/display: Indicate wait_resp based on FAMS even in disable path Alex Hung
2026-10-27 23:17 ` [PATCH 11/28] drm/amd/display: Update Rounding For VM stage groups Alex Hung
2026-10-27 23:17 ` [PATCH 12/28] drm/amd/display: Fix unadvertised mode detection Alex Hung
2026-10-27 23:17 ` [PATCH 13/28] drm/amd/display: Parameterize FCLK/PPT/Temp Read P-State Optimizer Alex Hung
2026-10-27 23:17 ` [PATCH 14/28] drm/amd/display: Reset DET of HUBPs without a plane before outstanding updates Alex Hung
2026-10-27 23:17 ` [PATCH 15/28] drm/amd/display: Decouple FAMS2 config update from dc/dc_state and add BLS opcode Alex Hung
2026-10-27 23:17 ` [PATCH 16/28] drm/amd/display: Add missing OTG_CRC1 reg/mask entries for DCN3.1.4 Alex Hung
2026-10-27 23:17 ` [PATCH 17/28] drm/amd/display: Add missing OTG_CRC1 reg/mask entries for DCN3.1.2 Alex Hung
2026-10-27 23:17 ` [PATCH 18/28] drm/amd/display: Skip dsc sequence for stream if dpms off Alex Hung
2026-10-27 23:17 ` [PATCH 19/28] drm/amd/display: Add debugfs override for HDMI VRR Alex Hung
2026-10-27 23:17 ` [PATCH 20/28] drm/amd/display: Enable immediate restore for FAMS on DCN6 Alex Hung
2026-10-27 23:17 ` [PATCH 21/28] drm/amd/display: Expand DSCCLK support check Alex Hung
2026-10-27 23:17 ` [PATCH 22/28] drm/amd/display: Add more backlight Kunit tests Alex Hung
2026-10-27 23:17 ` [PATCH 23/28] drm/amd/display: Add more color KUnit tests Alex Hung
2026-10-27 23:17 ` [PATCH 24/28] drm/amd/display: Add more CRC " Alex Hung
2026-10-27 23:17 ` [PATCH 25/28] drm/amd/display: Add more connector " Alex Hung
2026-10-27 23:17 ` [PATCH 26/28] drm/amd/display: Update alt shared lib to use dynamic state Alex Hung
2026-10-27 23:17 ` [PATCH 27/28] drm/amd/display: [FW Promotion] Release 0.1.82.0 Alex Hung
2026-10-27 23:17 ` [PATCH 28/28] drm/amd/display: Promote DC to 3.2.405 Alex Hung
2026-10-30 15:42 ` [PATCH 00/28] DC Patches Oct 27, 2026 Leo Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261027232005.2879750-9-alex.hung@amd.com \
--to=alex.hung@amd.com \
--cc=Chen-Yu.Chen@amd.com \
--cc=PingLei.Lin@amd.com \
--cc=Ray.Wu@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=aurabindo.pillai@amd.com \
--cc=chiahsuan.chung@amd.com \
--cc=daniel.wheeler@amd.com \
--cc=harry.wentland@amd.com \
--cc=ivan.lipski@amd.com \
--cc=jerry.zuo@amd.com \
--cc=mario.limonciello@amd.com \
--cc=roman.li@amd.com \
--cc=stable@vger.kernel.org \
--cc=sunpeng.li@amd.com \
--cc=wayne.lin@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.