1 From 048a36d8a6085bbd8ab9e5794b713b92ac986450 Mon Sep 17 00:00:00 2001
2 From: Shradha Gupta <shradhagupta@linux.microsoft.com>
3 Date: Thu, 1 Feb 2024 22:43:44 -0800
4 Subject: drm: Check polling initialized before enabling in drm_helper_probe_single_connector_modes
6 From: Shradha Gupta <shradhagupta@linux.microsoft.com>
8 commit 048a36d8a6085bbd8ab9e5794b713b92ac986450 upstream.
10 In function drm_helper_probe_single_connector_modes() when we enable
11 polling again, if it is already uninitialized, a warning is reported.
12 This patch fixes the warning message by checking if poll is initialized
15 Reported-by: kernel test robot <oliver.sang@intel.com>
16 Closes: https://lore.kernel.org/oe-lkp/202401191128.db8423f1-oliver.sang@intel.com
17 Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
18 Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
19 Link: https://patchwork.freedesktop.org/patch/msgid/1706856224-9725-1-git-send-email-shradhagupta@linux.microsoft.com
20 Cc: Holger Hoffstätte <holger@applied-asynchrony.com>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23 drivers/gpu/drm/drm_probe_helper.c | 8 ++++++--
24 1 file changed, 6 insertions(+), 2 deletions(-)
26 --- a/drivers/gpu/drm/drm_probe_helper.c
27 +++ b/drivers/gpu/drm/drm_probe_helper.c
28 @@ -629,8 +629,12 @@ retry:
32 - /* Re-enable polling in case the global poll config changed. */
33 - drm_kms_helper_poll_enable(dev);
35 + * Re-enable polling in case the global poll config changed but polling
36 + * is still initialized.
38 + if (dev->mode_config.poll_enabled)
39 + drm_kms_helper_poll_enable(dev);
41 if (connector->status == connector_status_disconnected) {
42 DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n",