drm: Set crc->opened to false before setting crc source to NULL.
Subsystems (2)
PATCH v3 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.
v3: set crc->opened to false without checking (Nick)
v2: Move spin_lock around entire crc->opened use (Daniel)
--- drivers/gpu/drm/drm_debugfs_crc.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/drm_debugfs_crc.c +5 -0
@@ -249,6 +249,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);
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 5 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.
Quoted 7 lines
v3: set
crc->openedto false without checking (Nick)
v2: Movespin_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]>
Looks like we dropped the ball on this and the other CRC patch. I'll merge them now.
Harry
Quoted 11 lines
--- drivers/gpu/drm/drm_debugfs_crc.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/drm_debugfs_crc.c +0
-0@@ -249,6 +249,11 @@ static int crtc_crc_release(struct inode *inode, struct file *filep)struct drm_crtc *crtc = filep->f_inode->i_private;
drivers/gpu/drm/drm_debugfs_crc.c static int crtc_crc_release(struct inode *inode, struct file *filep) · line 259
Quoted 10 lines
drivers/gpu/drm/drm_debugfs_crc.c +5
-0struct 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);
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel