]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/qxl: Fix missing KMS poll cleanup
authorMyeonghun Pak <mhun512@gmail.com>
Fri, 24 Apr 2026 11:25:18 +0000 (20:25 +0900)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 4 May 2026 12:54:44 +0000 (14:54 +0200)
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.

Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 5ff91e442652 ("qxl: use drm helper hotplug support")
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260424112543.57819-1-mhun512@gmail.com
drivers/gpu/drm/qxl/qxl_drv.c

index 2bbb1168a3ffa5c19fea560e45ee590f38fcab91..1e6a2392d7c6c3909023d2c61efd40832383c70c 100644 (file)
@@ -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)