drm: fix drm_mode_getconnector() locking imbalance regression
Subsystems (2)
PATCH 1/1 drm: fix drm_mode_getconnector() locking imbalance regression
Regression in commit 2caa80e72b57c6216aec6f6a11fcfb4fec46daa0
Author: Daniel Vetter <[email protected]> Date: Sun Feb 22 11:38:36 2015 +0100
drm: Fix deadlock due to getconnector locking changes
If the drm_connector_find() call returns NULL, we should no longer call drm_modeset_unlock() to avoid locking imbalance.
--- drivers/gpu/drm/drm_crtc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_crtc.c +3 -1
@@ -2121,7 +2121,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, connector =drm_connector_find (dev, out_resp->connector_id);if (!connector) { ret = -ENOENT ; - goto out; + goto out_unlock; }for (i =0 ; i <DRM_CONNECTOR_MAX_ENCODER ; i++)
@@ -2201,6 +2201,8 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, out:drm_modeset_unlock (&dev->mode_config.connection_mutex); + +out_unlock:mutex_unlock (&dev->mode_config.mutex);return ret;
Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 11 lines · Tommi Rantala
Regression in commit
2caa80e72b57c6216aec6f6a11fcfb4fec46daa0Author: Daniel Vetter <[email protected]> Date: Sun Feb 22 11:38:36 2015 +0100drm: Fix deadlock due to getconnector locking changes
If the
drm_connector_find()call returns NULL, we should no longer calldrm_modeset_unlock()to avoid locking imbalance.Signed-off-by Tommi Rantala <[email protected]>Cc Daniel Vetter <[email protected]>
Oops, thanks for catching this. If this missed 4.0 then we need to backport it.
Quoted 29 lines
--- drivers/gpu/drm/drm_crtc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/drm_crtc.c +3
-1@@ -2121,7 +2121,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, connector =drm_connector_find (dev, out_resp->connector_id);if (!connector) { ret = -ENOENT ; - goto out; + goto out_unlock; }for (i =0 ; i <DRM_CONNECTOR_MAX_ENCODER ; i++)@@ -2201,6 +2201,8 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, out:drm_modeset_unlock (&dev->mode_config.connection_mutex); + +out_unlock:mutex_unlock (&dev->mode_config.mutex);return ret;Signature · 1 line
2.1.0
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Jani Nikula
AppliedQuoted 10 lines · Daniel Vetter
Quoted 9 lines · Tommi Rantala
Regression in commit
2caa80e72b57c6216aec6f6a11fcfb4fec46daa0Author: Daniel Vetter <[email protected]> Date: Sun Feb 22 11:38:36 2015 +0100drm: Fix deadlock due to getconnector locking changes
If the
drm_connector_find()call returns NULL, we should no longer calldrm_modeset_unlock()to avoid locking imbalance.
Quoted 7 lines
Quoted 2 lines
Signed-off-by Tommi Rantala <[email protected]>Cc Daniel Vetter <[email protected]>Oops, thanks for catching this. If this missed 4.0 then we need to backport it.
Reviewed-by Daniel Vetter <[email protected]>
Pushed to topic/drm-fixes, should still make it to 4.0. Thanks for the patch and review.
BR,
Jani.
Quoted 39 lines
Quoted 30 lines
--- drivers/gpu/drm/drm_crtc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/drm_crtc.c +3
-1@@ -2121,7 +2121,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, connector =drm_connector_find (dev, out_resp->connector_id);if (!connector) { ret = -ENOENT ; - goto out; + goto out_unlock; }for (i =0 ; i <DRM_CONNECTOR_MAX_ENCODER ; i++)@@ -2201,6 +2201,8 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, out:drm_modeset_unlock (&dev->mode_config.connection_mutex); + +out_unlock:mutex_unlock (&dev->mode_config.mutex);return ret;Signature · 1 line
2.1.0Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel