From b72e2f4bbc25b94d5f9de96e141cd3e48106f9a5 Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 15 Apr 2024 01:48:11 +0000 Subject: [PATCH] drm: Check polling initialized before enabling in drm_helper_probe_single_connector_modes From Shradha Gupta 5c1dc516f52a5a0c0370086509ec12e6c3acb428 in linux-6.6.y/6.6.27 048a36d8a6085bbd8ab9e5794b713b92ac986450 in mainline linux --- sys/dev/pci/drm/drm_probe_helper.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/drm/drm_probe_helper.c b/sys/dev/pci/drm/drm_probe_helper.c index fd7deaa754d..da3d8e3eeaa 100644 --- a/sys/dev/pci/drm/drm_probe_helper.c +++ b/sys/dev/pci/drm/drm_probe_helper.c @@ -629,8 +629,12 @@ retry: 0); } - /* Re-enable polling in case the global poll config changed. */ - drm_kms_helper_poll_enable(dev); + /* + * Re-enable polling in case the global poll config changed but polling + * is still initialized. + */ + if (dev->mode_config.poll_enabled) + drm_kms_helper_poll_enable(dev); if (connector->status == connector_status_disconnected) { DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n", -- 2.20.1