All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	intel-gfx@lists.freedesktop.org,
	Keith Packard <keithp@keithp.com>
Subject: [RFC][PATCH 09/11] drm: Fix getconnector locking
Date: Tue, 27 Feb 2018 14:56:58 +0200	[thread overview]
Message-ID: <20180227125700.6527-10-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20180227125700.6527-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The edid is protected by mode_config.mutex so extend the locking to
protect the property readout part as well.

Cc: Keith Packard <keithp@keithp.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_connector.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 2bf19a37dbac..122060792b6f 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -1624,15 +1624,12 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
 			if (copy_to_user(mode_ptr + copied,
 					 &u_mode, sizeof(u_mode))) {
 				ret = -EFAULT;
-				mutex_unlock(&dev->mode_config.mutex);
-
 				goto out;
 			}
 			copied++;
 		}
 	}
 	out_resp->count_modes = mode_count;
-	mutex_unlock(&dev->mode_config.mutex);
 
 	drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
 	encoder = drm_connector_get_encoder(connector);
@@ -1650,6 +1647,8 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
 	drm_modeset_unlock(&dev->mode_config.connection_mutex);
 
 out:
+	mutex_unlock(&dev->mode_config.mutex);
+
 	drm_connector_put(connector);
 
 	return ret;
-- 
2.13.6

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

  parent reply	other threads:[~2018-02-27 12:56 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27 12:56 [RFC][PATCH 00/11] drm: Try to make display info less nuts Ville Syrjala
2018-02-27 12:56 ` Ville Syrjala
2018-02-27 12:56 ` [RFC][PATCH 01/11] drm/gma500: Fill display_info.{width, height}_mm from .get_modes() Ville Syrjala
2018-02-27 12:56 ` [RFC][PATCH 02/11] drm/i915: " Ville Syrjala
2018-02-27 12:56 ` [RFC][PATCH 03/11] drm/shmobile: Don't fill display_info.{width,height}_mm at init time Ville Syrjala
2018-02-27 12:56   ` [RFC][PATCH 03/11] drm/shmobile: Don't fill display_info.{width, height}_mm " Ville Syrjala
2018-02-27 12:56 ` [RFC][PATCH 04/11] drm: Split the display info into static and dynamic parts Ville Syrjala
2018-02-27 12:56   ` Ville Syrjala
2018-02-27 13:08   ` Maxime Ripard
2018-02-27 13:08     ` Maxime Ripard
2018-02-27 13:23   ` Philipp Zabel
2018-02-27 13:23     ` Philipp Zabel
2018-02-28  4:58   ` Archit Taneja
2018-02-28  4:58     ` Archit Taneja
2018-02-28  8:46   ` Sharma, Shashank
2018-02-28  8:46     ` Sharma, Shashank
2018-02-28  9:17   ` Stefan Agner
2018-02-28  9:17     ` Stefan Agner
2018-02-28 21:11   ` Alex Deucher
2018-02-28 21:11     ` Alex Deucher
2018-03-02  7:59   ` Linus Walleij
2018-03-02  7:59     ` Linus Walleij
2018-03-06  9:41   ` Daniel Vetter
2018-03-06  9:41     ` Daniel Vetter
2018-02-27 12:56 ` [RFC][PATCH 05/11] drm/edid: Clear display info fully Ville Syrjala
2018-02-28  8:58   ` Sharma, Shashank
2018-03-06  9:33   ` Daniel Vetter
2018-03-06  9:42     ` Daniel Vetter
2018-03-06  9:52     ` Daniel Vetter
2018-02-27 12:56 ` [RFC][PATCH 06/11] drm/edid: Don't call drm_add_display_info() with an invalid EDID Ville Syrjala
2018-03-06  9:45   ` Daniel Vetter
2018-02-27 12:56 ` [RFC][PATCH 07/11] drm/probe-helper: Avoid iterating the list twice on ww backoff Ville Syrjala
2018-03-06  9:49   ` Daniel Vetter
2018-03-06 11:48     ` Ville Syrjälä
2018-02-27 12:56 ` [RFC][PATCH 08/11] drm: Add drm_connector_fill_modes() Ville Syrjala
2018-03-06 10:00   ` Daniel Vetter
2018-03-06 10:30     ` Ville Syrjälä
2018-02-27 12:56 ` Ville Syrjala [this message]
2018-03-06  9:55   ` [RFC][PATCH 09/11] drm: Fix getconnector locking Daniel Vetter
2018-02-27 12:56 ` [RFC][PATCH 10/11] drm: Fix debugfs edid_override locking Ville Syrjala
2018-03-06  9:56   ` Daniel Vetter
2018-02-27 12:57 ` [RFC][PATCH 11/11] drm: Sprinkle lockdep asserts for edid/display_info Ville Syrjala
2018-03-06  9:31   ` Daniel Vetter
2018-03-06 12:18     ` Ville Syrjälä
2018-03-06 16:23       ` Harry Wentland
2018-03-06 17:13         ` Daniel Vetter
2018-03-06 18:32           ` Harry Wentland
2018-03-07 16:26             ` Daniel Vetter
2018-02-27 14:06 ` ✓ Fi.CI.BAT: success for drm: Try to make display info less nuts Patchwork
2018-02-27 20:14 ` ✗ Fi.CI.IGT: failure " Patchwork

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=20180227125700.6527-10-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=keithp@keithp.com \
    /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.