All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/i915: Protect MST retraining with connection_mutex
Date: Thu, 3 Sep 2015 15:11:20 +0300	[thread overview]
Message-ID: <20150903121120.GU29811@intel.com> (raw)
In-Reply-To: <1440689810-29585-2-git-send-email-ville.syrjala@linux.intel.com>

On Thu, Aug 27, 2015 at 06:36:48PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Grab the connection_mutex around MSR link retraining to protect it
> against a concurrent modeset. We already do the same for SST.
> 
> DP hpd_pulse can still otherwise race against modeset and ->detect(), so
> it's not clear what will happen when both want to scribble into eg.
> intel_dp->dpcd[] at the same time. But sorting it all out requires way
> more thought than I'm willing to expend now.

Actually I suppose this might not work out so well after all. I suppose
MST depends on short HPDs during modeset due to the sideband stuff.

So if we want to grab modeset locks for retraining, I suppose we'd
need to move the retraining to happen from .hot_plug() which gets run
from the other hotplug work, and so wouldn't interfere with sideband.

> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 9e90a2b..1259c9b 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -4391,6 +4391,7 @@ update_status:
>  static int
>  intel_dp_check_mst_status(struct intel_dp *intel_dp)
>  {
> +	struct drm_device *dev = dp_to_dig_port(intel_dp)->base.base.dev;
>  	bool bret;
>  
>  	if (intel_dp->is_mst) {
> @@ -4402,6 +4403,8 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
>  go_again:
>  		if (bret == true) {
>  
> +			drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
> +
>  			/* check link status - esi[10] = 0x200c */
>  			if (intel_dp->active_mst_links &&
>  			    !drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) {
> @@ -4411,6 +4414,8 @@ go_again:
>  				intel_dp_stop_link_train(intel_dp);
>  			}
>  
> +			drm_modeset_unlock(&dev->mode_config.connection_mutex);
> +
>  			DRM_DEBUG_KMS("got esi %3ph\n", esi);
>  			ret = drm_dp_mst_hpd_irq(&intel_dp->mst_mgr, esi, &handled);
>  
> -- 
> 2.4.6

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-09-03 12:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-27 15:36 [PATCH 0/3] drm/i915: MST link training locking and cleanups ville.syrjala
2015-08-27 15:36 ` [PATCH 1/3] drm/i915: Protect MST retraining with connection_mutex ville.syrjala
2015-09-03 12:11   ` Ville Syrjälä [this message]
2015-09-16 11:48     ` Maarten Lankhorst
2015-09-23  8:01       ` Daniel Vetter
2015-08-27 15:36 ` [PATCH 2/3] drm/i915: Flatten the mst suspend/resume functions a bit ville.syrjala
2015-09-16 12:28   ` Maarten Lankhorst
2015-08-27 15:36 ` [PATCH 3/3] drm/i915: Flatten intel_dp_check_mst_status() ville.syrjala
2015-09-16 13:07   ` Maarten Lankhorst

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=20150903121120.GU29811@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@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.