]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/gpu/drm/drm_debugfs_crc.c
drm: Set crc->opened to false before setting crc source to NULL.
[linux.git] / drivers / gpu / drm / drm_debugfs_crc.c
index 2ece2957da1aff26eb48b8bbd0cd8c57775d08cc..e22b812c4b802c0e6610498b36aa30bf99efb54b 100644 (file)
@@ -258,6 +258,11 @@ static int crtc_crc_release(struct inode *inode, struct file *filep)
        struct drm_crtc *crtc = filep->f_inode->i_private;
        struct drm_crtc_crc *crc = &crtc->crc;
 
+       /* terminate the infinite while loop if 'drm_dp_aux_crc_work' running */
+       spin_lock_irq(&crc->lock);
+       crc->opened = false;
+       spin_unlock_irq(&crc->lock);
+
        crtc->funcs->set_crc_source(crtc, NULL);
 
        spin_lock_irq(&crc->lock);