drm: Set crc->opened to false before setting crc source to NULL.
Subsystems (2)
PATCH v2 1/1 drm: Set crc->opened to false before setting crc source to NULL.
From: Dingchen Zhang <[email protected]>
to terminate the while-loop in drm_dp_aux_crc_work when drm_dp_start/stop_crc are called in the hook to set crc source.
v2: Move spin_lock around entire crc->opened use (Daniel)
--- drivers/gpu/drm/drm_debugfs_crc.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/drm_debugfs_crc.c +6 -0
@@ -249,6 +249,12 @@ 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); +if (crc->opened) + crc->opened = false; +spin_unlock_irq (&crc->lock); + crtc->funcs->set_crc_source (crtc,NULL );spin_lock_irq (&crc->lock);
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 20 lines · David (Dingchen) Zhang
From: Dingchen Zhang <[email protected]>
to terminate the while-loop in
drm_dp_aux_crc_workwhen drm_dp_start/stop_crc are called in the hook to set crc source.v2: Move
spin_lockaround entirecrc->openeduse (Daniel)Cc Daniel Vetter <[email protected]>Cc Harry Wentland <[email protected]>Cc Nick Kazlauskas <[email protected]>Signed-off-by Dingchen Zhang <[email protected]>--- drivers/gpu/drm/drm_debugfs_crc.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/gpu/drm/drm_debugfs_crc.c +0
-0
drivers/gpu/drm/drm_debugfs_crc.c static int crtc_crc_release(struct inode *inode, struct file *filep) · line 255
Quoted 7 lines
drivers/gpu/drm/drm_debugfs_crc.c +4
-0@@ -249,6 +249,12 @@ 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); +if (crc->opened) + crc->opened = false;
You can just set this to false, no need to check the value really.
Nicholas Kazlauskas
drivers/gpu/drm/drm_debugfs_crc.c static int crtc_crc_release(struct inode *inode, struct file *filep) · line 260
Quoted 6 lines
drivers/gpu/drm/drm_debugfs_crc.c +2
-0+spin_unlock_irq (&crc->lock); + crtc->funcs->set_crc_source (crtc,NULL );spin_lock_irq (&crc->lock);
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel