[PATCH 2/2] drm: Set crc->opened = false before setting crc source to NULL.

Harry Wentland hwentlan at amd.com
Fri Jun 21 14:21:43 UTC 2019


On 2019-06-05 1:06 p.m., Dingchen Zhang wrote:
> 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 at amd.com>, Harry <Harry.Wentland at amd.com>, Nick <Nicholas.Kazlauskas at amd.com>
> Signed-off-by: Dingchen Zhang <dingchen.zhang at amd.com>

I wonder how this isn't creating problems for Rockchip with the Analogix
bridge.

Reviewed-by: Harry Wentland <harry.wentland at amd.com>

Harry

> ---
>  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);
> 


More information about the dri-devel mailing list