AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Clear HDMI HPD pending work only if it is enabled
@ 2026-01-16 15:03 IVAN.LIPSKI
  2026-01-16 15:07 ` Mario Limonciello (AMD) (kernel.org)
  0 siblings, 1 reply; 2+ messages in thread
From: IVAN.LIPSKI @ 2026-01-16 15:03 UTC (permalink / raw)
  To: amd-gfx; +Cc: Mario Limonciello, Alex Deucher, stable, Ivan Lipski

From: Ivan Lipski <ivan.lipski@amd.com>

[Why&How]
On amdgpu_dm_connector_destroy(), the driver attempts to cancel pending
HDMI HPD work without checking if the HDMI HPD is enabled.

Added a check that it is enabled before clearing it.

Fixes: d98e9c0497ae ("drm/amd/display: Add an hdmi_hpd_debounce_delay_ms module")

Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 655c9fcb078a..cba7546d3f95 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7743,10 +7743,12 @@ static void amdgpu_dm_connector_destroy(struct drm_connector *connector)
 		drm_dp_mst_topology_mgr_destroy(&aconnector->mst_mgr);
 
 	/* Cancel and flush any pending HDMI HPD debounce work */
-	cancel_delayed_work_sync(&aconnector->hdmi_hpd_debounce_work);
-	if (aconnector->hdmi_prev_sink) {
-		dc_sink_release(aconnector->hdmi_prev_sink);
-		aconnector->hdmi_prev_sink = NULL;
+	if (aconnector->hdmi_hpd_debounce_delay_ms) {
+		cancel_delayed_work_sync(&aconnector->hdmi_hpd_debounce_work);
+		if (aconnector->hdmi_prev_sink) {
+			dc_sink_release(aconnector->hdmi_prev_sink);
+			aconnector->hdmi_prev_sink = NULL;
+		}
 	}
 
 	if (aconnector->bl_idx != -1) {
-- 
2.43.0


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

* Re: [PATCH] drm/amd/display: Clear HDMI HPD pending work only if it is enabled
  2026-01-16 15:03 [PATCH] drm/amd/display: Clear HDMI HPD pending work only if it is enabled IVAN.LIPSKI
@ 2026-01-16 15:07 ` Mario Limonciello (AMD) (kernel.org)
  0 siblings, 0 replies; 2+ messages in thread
From: Mario Limonciello (AMD) (kernel.org) @ 2026-01-16 15:07 UTC (permalink / raw)
  To: IVAN.LIPSKI, amd-gfx; +Cc: Alex Deucher, stable



On 1/16/2026 9:03 AM, IVAN.LIPSKI@amd.com wrote:
> From: Ivan Lipski <ivan.lipski@amd.com>
> 
> [Why&How]
> On amdgpu_dm_connector_destroy(), the driver attempts to cancel pending
> HDMI HPD work without checking if the HDMI HPD is enabled.
> 
> Added a check that it is enabled before clearing it.
> 
> Fixes: d98e9c0497ae ("drm/amd/display: Add an hdmi_hpd_debounce_delay_ms module")
> 
> Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 655c9fcb078a..cba7546d3f95 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -7743,10 +7743,12 @@ static void amdgpu_dm_connector_destroy(struct drm_connector *connector)
>   		drm_dp_mst_topology_mgr_destroy(&aconnector->mst_mgr);
>   
>   	/* Cancel and flush any pending HDMI HPD debounce work */
> -	cancel_delayed_work_sync(&aconnector->hdmi_hpd_debounce_work);
> -	if (aconnector->hdmi_prev_sink) {
> -		dc_sink_release(aconnector->hdmi_prev_sink);
> -		aconnector->hdmi_prev_sink = NULL;
> +	if (aconnector->hdmi_hpd_debounce_delay_ms) {
> +		cancel_delayed_work_sync(&aconnector->hdmi_hpd_debounce_work);
> +		if (aconnector->hdmi_prev_sink) {
> +			dc_sink_release(aconnector->hdmi_prev_sink);
> +			aconnector->hdmi_prev_sink = NULL;
> +		}
>   	}
>   
>   	if (aconnector->bl_idx != -1) {


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

end of thread, other threads:[~2026-01-16 15:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-16 15:03 [PATCH] drm/amd/display: Clear HDMI HPD pending work only if it is enabled IVAN.LIPSKI
2026-01-16 15:07 ` Mario Limonciello (AMD) (kernel.org)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox