All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>, Dave Airlie <airlied@gmail.com>
Cc: adam_richter2004@yahoo.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/dp/mst: take lock around looking up the branch device on hpd irq
Date: Fri, 16 Oct 2015 12:49:46 +0300	[thread overview]
Message-ID: <874mhrnnwl.fsf@intel.com> (raw)
In-Reply-To: <20150622070743.GJ25769@phenom.ffwll.local>

On Mon, 22 Jun 2015, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Mon, Jun 22, 2015 at 02:40:44PM +1000, Dave Airlie wrote:
>> From: Dave Airlie <airlied@redhat.com>
>> 
>> If we are doing an MST transaction and we've gotten HPD and we
>> lookup the device from the incoming msg, we should take the mgr
>> lock around it, so that mst_primary and mstb->ports are valid.
>> 
>> Signed-off-by: Dave Airlie <airlied@redhat.com>
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

The error path fails to unlock the mutex, reported in [1]. There's a fix
in the bug, I've asked Adam to post it to the list.

BR,
Jani.


[1] https://bugs.freedesktop.org/show_bug.cgi?id=92480


>
>> ---
>>  drivers/gpu/drm/drm_dp_mst_topology.c | 3 +++
>>  1 file changed, 3 insertions(+)
>> 
>> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
>> index 3c7e5cd..15a6d8e 100644
>> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
>> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
>> @@ -1175,6 +1175,8 @@ static struct drm_dp_mst_branch *drm_dp_get_mst_branch_device(struct drm_dp_mst_
>>  	struct drm_dp_mst_port *port;
>>  	int i;
>>  	/* find the port by iterating down */
>> +
>> +	mutex_lock(&mgr->lock);
>>  	mstb = mgr->mst_primary;
>>  
>>  	for (i = 0; i < lct - 1; i++) {
>> @@ -1194,6 +1196,7 @@ static struct drm_dp_mst_branch *drm_dp_get_mst_branch_device(struct drm_dp_mst_
>>  		}
>>  	}
>>  	kref_get(&mstb->kref);
>> +	mutex_unlock(&mgr->lock);
>>  	return mstb;
>>  }
>>  
>> -- 
>> 2.4.1
>> 
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
> -- 
> 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

  reply	other threads:[~2015-10-16  9:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-22  4:40 [PATCH 1/2] drm/dp: look up the mstb passed into work function (v2) Dave Airlie
2015-06-22  4:40 ` [PATCH 2/2] drm/dp/mst: take lock around looking up the branch device on hpd irq Dave Airlie
2015-06-22  7:07   ` Daniel Vetter
2015-10-16  9:49     ` Jani Nikula [this message]
2015-06-22  7:18 ` [PATCH 1/2] drm/dp: look up the mstb passed into work function (v2) Daniel Vetter

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=874mhrnnwl.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=adam_richter2004@yahoo.com \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    /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.