Skip to contentSkip to conversation

drm: Set crc->opened to false before setting crc source to NULL.

PATCH In review David (Dingchen) Zhang 2 participants 2 messages Jul 26, 2019 – Jan 2, 2020

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

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)

Cc Daniel Vetter <[email protected]>
Cc Harry Wentland <[email protected]>
Cc Nick Kazlauskas <[email protected]>
---
 drivers/gpu/drm/drm_debugfs_crc.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/drm_debugfs_crc.c +5 -0
index dac267e840af..d2d2389d8892 100644
@@ -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
Reviewed-by on v3 1/1
#1 lore raw
Quoted 5 lines · David (Dingchen) Zhang

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.

Quoted 7 lines

v3: set crc->opened to false without checking (Nick)
v2: Move spin_lock around entire crc->opened use (Daniel)

Cc Daniel Vetter <[email protected]>
Cc Harry Wentland <[email protected]>
Cc Nick Kazlauskas <[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
index dac267e840af..d2d2389d8892 100644
@@ -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 -0
 	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);

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel