Skip to contentSkip to conversation

drm/qxl: Fix missing KMS poll cleanup

PATCH In review Myeonghun Pak 2 participants 3 messages Apr 24 – May 2

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/qxl: Fix missing KMS poll cleanup

drm_kms_helper_poll_init() initializes the output polling work and enables polling for the DRM device. qxl enables polling before calling drm_dev_register(), but the drm_dev_register() failure path tears down the modeset and device state without disabling the polling helper.

The remove path also unregisters and shuts down the DRM device without first disabling the polling helper. Add matching drm_kms_helper_poll_fini() calls in both paths so the delayed polling work is cancelled before qxl tears down the associated modeset/device state.

---
 drivers/gpu/drm/qxl/qxl_drv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/qxl/qxl_drv.c +4 -2
index 2bbb1168a3..1e6a2392d7 100644
@@ -118,12 +118,13 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	/* Complete initialization. */
 	ret = drm_dev_register(&qdev->ddev, ent->driver_data);
 	if (ret)
-		goto modeset_cleanup;
+		goto poll_fini;
 
 	drm_client_setup(&qdev->ddev, NULL);
 	return 0;
 
-modeset_cleanup:
+poll_fini:
+	drm_kms_helper_poll_fini(&qdev->ddev);
 	qxl_modeset_fini(qdev);
 unload:
 	qxl_device_fini(qdev);
@@ -154,6 +155,7 @@ qxl_pci_remove(struct pci_dev *pdev)
 {
 	struct drm_device *dev = pci_get_drvdata(pdev);
 
+	drm_kms_helper_poll_fini(dev);
 	drm_dev_unregister(dev);
 	drm_atomic_helper_shutdown(dev);
 	if (pci_is_vga(pdev) && pdev->revision < 5)
Signature · 1 line
2.50.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Thanks for your patch.

Am 24.04.26 um 13:25 schrieb Myeonghun Pak:

Quoted 11 lines

drm_kms_helper_poll_init() initializes the output polling work and enables polling for the DRM device. qxl enables polling before calling drm_dev_register(), but the drm_dev_register() failure path tears down the modeset and device state without disabling the polling helper.

The remove path also unregisters and shuts down the DRM device without first disabling the polling helper. Add matching drm_kms_helper_poll_fini() calls in both paths so the delayed polling work is cancelled before qxl tears down the associated modeset/device state.

Fixes 5ff91e442652 ("qxl: use drm helper hotplug support")
Cc <[email protected]> # v3.11+
Quoted 32 lines
---
  drivers/gpu/drm/qxl/qxl_drv.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/qxl/qxl_drv.c +4 -2
index 2bbb1168a3..1e6a2392d7 100644
@@ -118,12 +118,13 @@ qxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
  	/* Complete initialization. */
  	ret = drm_dev_register(&qdev->ddev, ent->driver_data);
  	if (ret)
-		goto modeset_cleanup;
+		goto poll_fini;
 
  	drm_client_setup(&qdev->ddev, NULL);
  	return 0;
 
-modeset_cleanup:
+poll_fini:
+	drm_kms_helper_poll_fini(&qdev->ddev);
  	qxl_modeset_fini(qdev);
  unload:
  	qxl_device_fini(qdev);
@@ -154,6 +155,7 @@ qxl_pci_remove(struct pci_dev *pdev)
  {
  	struct drm_device *dev = pci_get_drvdata(pdev);
 
+	drm_kms_helper_poll_fini(dev);
  	drm_dev_unregister(dev);
  	drm_atomic_helper_shutdown(dev);
  	if (pci_is_vga(pdev) && pdev->revision < 5)
Signature · 6 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
#2 lore raw

Hello Thomas,

Thanks for the review. I appreciate the Fixes tag, and the suggestion for stable.

Best regards,

Myeonghun Pak

2026년 4월 27일 (월) 오후 5:46, Thomas Zimmermann <[email protected]>님이 작성:

Quoted 68 lines

Thanks for your patch.

Am 24.04.26 um 13:25 schrieb Myeonghun Pak:

Quoted 7 lines

drm_kms_helper_poll_init() initializes the output polling work and enables polling for the DRM device. qxl enables polling before calling drm_dev_register(), but the drm_dev_register() failure path tears down the modeset and device state without disabling the polling helper.

The remove path also unregisters and shuts down the DRM device without first disabling the polling helper. Add matching

drm_kms_helper_poll_fini()

Quoted 4 lines

calls in both paths so the delayed polling work is cancelled before qxl tears down the associated modeset/device state.

Fixes 5ff91e442652 ("qxl: use drm helper hotplug support")
Cc <[email protected]> # v3.11+

Review

Quoted 5 lines
---
  drivers/gpu/drm/qxl/qxl_drv.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/qxl/qxl_drv.c

drivers/gpu/drm/qxl/qxl_drv.c qxl_pci_probe(struct pci_dev *pdev, const struct

Quoted 4 lines

index 2bbb1168a3..1e6a2392d7 100644

drivers/gpu/drm/qxl/qxl_drv.c +0 -0
@@ -118,12 +118,13 @@ qxl_pci_probe(struct pci_dev *pdev, const struct

pci_device_id *ent)

Quoted 16 lines
drivers/gpu/drm/qxl/qxl_drv.c +3 -2
      /* Complete initialization. */
      ret = drm_dev_register(&qdev->ddev, ent->driver_data);
      if (ret)
-             goto modeset_cleanup;
+             goto poll_fini;
 
      drm_client_setup(&qdev->ddev, NULL);
      return 0;
 
-modeset_cleanup:
+poll_fini:
+     drm_kms_helper_poll_fini(&qdev->ddev);
      qxl_modeset_fini(qdev);
  unload:
      qxl_device_fini(qdev);

drivers/gpu/drm/qxl/qxl_drv.c qxl_pci_remove(struct pci_dev *pdev) · line 161

Quoted 7 lines
drivers/gpu/drm/qxl/qxl_drv.c +1 -0
@@ -154,6 +155,7 @@ qxl_pci_remove(struct pci_dev *pdev)
  {
      struct drm_device *dev = pci_get_drvdata(pdev);
 
+     drm_kms_helper_poll_fini(dev);
      drm_dev_unregister(dev);
      drm_atomic_helper_shutdown(dev);
      if (pci_is_vga(pdev) && pdev->revision < 5)

--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)