]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm: Check polling initialized before enabling in drm_helper_probe_single_connector_modes
authorShradha Gupta <shradhagupta@linux.microsoft.com>
Fri, 2 Feb 2024 06:43:44 +0000 (22:43 -0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 28 Feb 2024 14:07:22 +0000 (15:07 +0100)
In function drm_helper_probe_single_connector_modes() when we enable
polling again, if it is already uninitialized, a warning is reported.
This patch fixes the warning message by checking if poll is initialized
before enabling it.

Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202401191128.db8423f1-oliver.sang@intel.com
Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1706856224-9725-1-git-send-email-shradhagupta@linux.microsoft.com
drivers/gpu/drm/drm_probe_helper.c

index 87d78d8206ffbae2cef2805bacef4f38959eaa28..19ecb749704bee4ecdf29d56e41eb871fb0e5d62 100644 (file)
@@ -622,8 +622,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",