diff mbox

drm: Check for connection_mutex in drm_select_eld

Message ID 1405610718-7897-1-git-send-email-seanpaul@chromium.org (mailing list archive)
State New, archived
Headers show

Commit Message

Sean Paul July 17, 2014, 3:25 p.m. UTC
drm_select_eld should check for mode_config.connection_mutex as
well as mode_config.mutex

Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 drivers/gpu/drm/drm_edid.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Daniel Vetter July 18, 2014, 1:34 p.m. UTC | #1
On Thu, Jul 17, 2014 at 11:25:18AM -0400, Sean Paul wrote:
> drm_select_eld should check for mode_config.connection_mutex as
> well as mode_config.mutex
> 
> Signed-off-by: Sean Paul <seanpaul@chromium.org>

Indeed. Although the commit message is a bit thin, it should explain why
we need the connection mutex, too. Pimped it and stoved in my
topic/core-stuff branch for eventual forwarding to Dave.
-Daniel

> ---
>  drivers/gpu/drm/drm_edid.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index dfa9769..087d608 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3305,6 +3305,7 @@ struct drm_connector *drm_select_eld(struct drm_encoder *encoder,
>  	struct drm_device *dev = encoder->dev;
>  
>  	WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
> +	WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
>  
>  	list_for_each_entry(connector, &dev->mode_config.connector_list, head)
>  		if (connector->encoder == encoder && connector->eld[0])
> -- 
> 2.0.0
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index dfa9769..087d608 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3305,6 +3305,7 @@  struct drm_connector *drm_select_eld(struct drm_encoder *encoder,
 	struct drm_device *dev = encoder->dev;
 
 	WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
+	WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
 
 	list_for_each_entry(connector, &dev->mode_config.connector_list, head)
 		if (connector->encoder == encoder && connector->eld[0])