From: Jani Nikula <jani.nikula@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>, Tommi Rantala <tt.rantala@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm: fix drm_mode_getconnector() locking imbalance regression
Date: Tue, 07 Apr 2015 13:42:04 +0300 [thread overview]
Message-ID: <87vbh8jk3n.fsf@intel.com> (raw)
In-Reply-To: <20150407060927.GK6354@phenom.ffwll.local>
On Tue, 07 Apr 2015, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Fri, Apr 03, 2015 at 10:45:29AM +0300, Tommi Rantala wrote:
>> Regression in commit 2caa80e72b57c6216aec6f6a11fcfb4fec46daa0
>> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
>> 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.
>>
>> Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> Oops, thanks for catching this. If this missed 4.0 then we need to
> backport it.
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Pushed to topic/drm-fixes, should still make it to 4.0. Thanks for the
patch and review.
BR,
Jani.
>
>> ---
>> drivers/gpu/drm/drm_crtc.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
>> index 679b10e..b6f076b 100644
>> --- a/drivers/gpu/drm/drm_crtc.c
>> +++ b/drivers/gpu/drm/drm_crtc.c
>> @@ -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;
>> --
>> 2.1.0
>>
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2015-04-07 10:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-03 7:45 [PATCH] drm: fix drm_mode_getconnector() locking imbalance regression Tommi Rantala
2015-04-07 6:09 ` Daniel Vetter
2015-04-07 10:42 ` Jani Nikula [this message]
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=87vbh8jk3n.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=tt.rantala@gmail.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.