Skip to contentSkip to conversation

FAILED: patch "[PATCH] drm/amd/display: Avoid closing unowned DDC pins" failed to apply to 5.15-stable tree

PATCH New Sasha Levin 1 participant 2 messages Nov 10 – Nov 14

Subsystems (4)
lore
Share & tools
lore

Sasha Levin

author maintainer
#0 lore raw

The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x e7ba638b8116cb5f1a5690f543052371215f1626
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 5.15.y' 'HEAD^..'

Thanks,
Sasha

------------------ original commit in Linus's tree ------------------

From e7ba638b8116cb5f1a5690f543052371215f1626 Mon Sep 17 00:00:00 2001
From: Alex Hung <[email protected]>
Date: Tue, 27 Oct 2026 17:17:04 -0600
Subject: [PATCH] drm/amd/display: Avoid closing unowned DDC pins

[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 <[email protected]>
Cc Mario Limonciello <[email protected]>
Cc Alex Deucher <[email protected]>
(cherry picked from commit 175ae7772b68757b4932f34ff862923cab7abe21)
---
 .../drm/amd/display/dc/link/protocols/link_dp_capability.c  | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +1 -5
index ad1a499b0d9d2..c487c5b87dfd7 100644
@@ -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
Signature · 1 line
2.53.0
author maintainer
#1 lore raw

PATCH 1/1 drm/amd/display: Avoid closing unowned DDC pins

From: Alex Hung <[email protected]>

[ Upstream commit e7ba638b8116cb5f1a5690f543052371215f1626 ]

[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 <[email protected]>
Cc Mario Limonciello <[email protected]>
Cc Alex Deucher <[email protected]>
(cherry picked from commit 175ae7772b68757b4932f34ff862923cab7abe21)
[ sashal: adjusted context for dc_link_is_dp_sink_present() instead of dp_is_sink_present() ]
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -5
index 6696372b82f4b..00d5190db5ed6 100644
@@ -392,12 +392,8 @@ bool dc_link_is_dp_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
Signature · 1 line
2.53.0