public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Lyude Paul <lyude@redhat.com>
Cc: Ramya SR <quic_rsr@quicinc.com>, David Airlie <airlied@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>, Wayne Lin <Wayne.Lin@amd.com>,
	Jani Nikula <jani.nikula@intel.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Jeff Layton <jlayton@kernel.org>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] drm/dp/mst: fix missing modeset unlock for MST port detect
Date: Fri, 22 Sep 2023 22:22:21 +0300	[thread overview]
Message-ID: <ZQ3pbVHRXMiLfUCf@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <19ce2cd9abfd3bdf3ea91f9bceb43206e4740c2e.camel@redhat.com>

On Fri, Sep 22, 2023 at 03:02:23PM -0400, Lyude Paul wrote:
> 
> Oh! wow thank you for catching this:
> 
> Reviewed-by: Lyude Paul <lyude@redhat.com>
> 
> I will go and push this to drm-misc-next in just a moment
> 
> On Fri, 2023-09-15 at 10:24 +0530, Ramya SR wrote:
> > Modeset mutex unlock is missing in drm_dp_mst_detect_port function.
> > This will lead to deadlock if calling the function multiple times in
> > an atomic operation, for example, getting imultiple MST ports status
> > for a DP MST bonding scenario.
> > 
> > Signed-off-by: Ramya SR <quic_rsr@quicinc.com>
> > ---
> >  drivers/gpu/drm/display/drm_dp_mst_topology.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c
> > index ed96cfc..d6512c4 100644
> > --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
> > +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
> > @@ -4154,7 +4154,7 @@ drm_dp_mst_detect_port(struct drm_connector *connector,
> >  
> >  	ret = drm_modeset_lock(&mgr->base.lock, ctx);
> >  	if (ret)
> > -		goto out;
> > +		goto fail;
> >  
> >  	ret = connector_status_disconnected;
> >  
> > @@ -4181,6 +4181,8 @@ drm_dp_mst_detect_port(struct drm_connector *connector,
> >  		break;
> >  	}
> >  out:
> > +	drm_modeset_unlock(&mgr->base.lock);

Isn't this supposed to be unlocked only by drm_helper_probe_detect_ctx()
/ drm_helper_probe_detect() ?

> > +fail:
> >  	drm_dp_mst_topology_put_port(port);
> >  	return ret;
> >  }
> 
> -- 
> Cheers,
>  Lyude Paul (she/her)
>  Software Engineer at Red Hat
> 

  reply	other threads:[~2023-09-22 19:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-15  4:54 [PATCH v1] drm/dp/mst: fix missing modeset unlock for MST port detect Ramya SR
2023-09-22  9:41 ` Ramya SR
2023-09-22 19:02 ` Lyude Paul
2023-09-22 19:22   ` Imre Deak [this message]
2023-09-22 19:23     ` Lyude Paul
2023-09-25 14:57     ` Alex Deucher
2023-09-26 10:41       ` Ramya SR
2023-09-28  2:25         ` Ramya SR
2023-09-28  8:23           ` Jani Nikula
2023-09-29  4:44           ` Ramya SR
2023-09-29  7:53             ` Jani Nikula

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=ZQ3pbVHRXMiLfUCf@ideak-desk.fi.intel.com \
    --to=imre.deak@intel.com \
    --cc=Wayne.Lin@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=jlayton@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=quic_rsr@quicinc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox