Commit acecfee8 authored by Ivan Lipski's avatar Ivan Lipski Committed by Alex Deucher
Browse files

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: 6a681cd9 ("drm/amd/display: Add an hdmi_hpd_debounce_delay_ms module")
Signed-off-by: default avatarIvan Lipski <ivan.lipski@amd.com>
Reviewed-by: default avatarMario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 17b2c526)
parent ee8d07cd
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -7754,11 +7754,13 @@ 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 */
	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) {
		backlight_device_unregister(dm->backlight_dev[aconnector->bl_idx]);