All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dingchen Zhang <dingchen.zhang@amd.com>
To: dri-devel@lists.freedesktop.org
Cc: Dingchen Zhang <dingchen.zhang@amd.com>
Subject: [PATCH 2/2] drm: Set crc->opened = false before setting crc source to NULL.
Date: Wed, 5 Jun 2019 13:06:39 -0400	[thread overview]
Message-ID: <20190605170639.8368-2-dingchen.zhang@amd.com> (raw)
In-Reply-To: <20190605170639.8368-1-dingchen.zhang@amd.com>

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.

Cc:Leo Li <sunpeng.li@amd.com>, Harry <Harry.Wentland@amd.com>, Nick <Nicholas.Kazlauskas@amd.com>
Signed-off-by: Dingchen Zhang <dingchen.zhang@amd.com>
---
 drivers/gpu/drm/drm_debugfs_crc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c
index e20adef9d623..0e8bcc130383 100644
--- a/drivers/gpu/drm/drm_debugfs_crc.c
+++ b/drivers/gpu/drm/drm_debugfs_crc.c
@@ -249,6 +249,13 @@ 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 */
+	if (crc->opened) {
+		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);
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-06-05 17:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05 17:06 [PATCH 1/2] drm: not to read outside the boundary for CRC source name Dingchen Zhang
2019-06-05 17:06 ` Dingchen Zhang [this message]
2019-06-05 17:54   ` [PATCH 2/2] drm: Set crc->opened = false before setting crc source to NULL Sam Ravnborg
2019-06-21 14:21   ` Harry Wentland
2019-06-21 15:46     ` Daniel Vetter
2019-06-21 16:15       ` Kazlauskas, Nicholas
2019-07-26 15:40       ` David Zhang
2019-06-05 17:50 ` [PATCH 1/2] drm: not to read outside the boundary for CRC source name Sam Ravnborg
2019-06-05 18:34   ` David Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190605170639.8368-2-dingchen.zhang@amd.com \
    --to=dingchen.zhang@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.