Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Clear HDMI HPD pending work only if it is enabled

[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: 6a681cd90345 ("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>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 17b2c526fd8026d8e0f4c0e7f94fc517e3901589)

authored by

Ivan Lipski and committed by
Alex Deucher
acecfee8 ee8d07cd

+6 -4
+6 -4
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 7754 7754 drm_dp_mst_topology_mgr_destroy(&aconnector->mst_mgr); 7755 7755 7756 7756 /* Cancel and flush any pending HDMI HPD debounce work */ 7757 - cancel_delayed_work_sync(&aconnector->hdmi_hpd_debounce_work); 7758 - if (aconnector->hdmi_prev_sink) { 7759 - dc_sink_release(aconnector->hdmi_prev_sink); 7760 - aconnector->hdmi_prev_sink = NULL; 7757 + if (aconnector->hdmi_hpd_debounce_delay_ms) { 7758 + cancel_delayed_work_sync(&aconnector->hdmi_hpd_debounce_work); 7759 + if (aconnector->hdmi_prev_sink) { 7760 + dc_sink_release(aconnector->hdmi_prev_sink); 7761 + aconnector->hdmi_prev_sink = NULL; 7762 + } 7761 7763 } 7762 7764 7763 7765 if (aconnector->bl_idx != -1) {