diff mbox series

[v2,4/6] drm/i915/dp: Do not grab crtc modeset lock in intel_dp_detect()

Message ID 20180924224528.4744-4-dhinakaran.pandiyan@intel.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/6] drm/i915/dp: Fix link retraining comment in intel_dp_long_pulse() | expand

Commit Message

Dhinakaran Pandiyan Sept. 24, 2018, 10:45 p.m. UTC
A crtc modeset lock was added for link retraining but
intel_dp_retrain_link() knows to take the necessary locks since
commit c85d200e8321 ("drm/i915: Move SST DP link retraining into the
->post_hotplug() hook")

Fixes: c85d200e8321 ("drm/i915: Move SST DP link retraining into the ->post_hotplug() hook")
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

Comments

Souza, Jose Sept. 25, 2018, 8:58 p.m. UTC | #1
On Mon, 2018-09-24 at 15:45 -0700, Dhinakaran Pandiyan wrote:
> A crtc modeset lock was added for link retraining but
> intel_dp_retrain_link() knows to take the necessary locks since
> commit c85d200e8321 ("drm/i915: Move SST DP link retraining into the
> ->post_hotplug() hook")
> 
> Fixes: c85d200e8321 ("drm/i915: Move SST DP link retraining into the
> ->post_hotplug() hook")

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>

> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 22 ++++++++--------------
>  1 file changed, 8 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c
> b/drivers/gpu/drm/i915/intel_dp.c
> index 09229fc66dec..87a631098a6d 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -5079,8 +5079,13 @@ intel_dp_long_pulse(struct intel_connector
> *connector,
>  	 * Some external monitors do not signal loss of link
> synchronization
>  	 * with an IRQ_HPD, so force a link status check.
>  	 */
> -	if (!intel_dp_is_edp(intel_dp))
> -		intel_dp_retrain_link(encoder, ctx);
> +	if (!intel_dp_is_edp(intel_dp)) {
> +		int ret;
> +
> +		ret = intel_dp_retrain_link(encoder, ctx);
> +		if (ret)
> +			return ret;
> +	}
>  
>  	/*
>  	 * Clearing NACK and defer counts to get their exact values
> @@ -5130,19 +5135,8 @@ intel_dp_detect(struct drm_connector
> *connector,
>  		      connector->base.id, connector->name);
>  
>  	/* If full detect is not performed yet, do a full detect */
> -	if (!intel_dp->detect_done) {
> -		struct drm_crtc *crtc;
> -		int ret;
> -
> -		crtc = connector->state->crtc;
> -		if (crtc) {
> -			ret = drm_modeset_lock(&crtc->mutex, ctx);
> -			if (ret)
> -				return ret;
> -		}
> -
> +	if (!intel_dp->detect_done)
>  		status = intel_dp_long_pulse(intel_dp-
> >attached_connector, ctx);
> -	}
>  
>  	intel_dp->detect_done = false;
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 09229fc66dec..87a631098a6d 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -5079,8 +5079,13 @@  intel_dp_long_pulse(struct intel_connector *connector,
 	 * Some external monitors do not signal loss of link synchronization
 	 * with an IRQ_HPD, so force a link status check.
 	 */
-	if (!intel_dp_is_edp(intel_dp))
-		intel_dp_retrain_link(encoder, ctx);
+	if (!intel_dp_is_edp(intel_dp)) {
+		int ret;
+
+		ret = intel_dp_retrain_link(encoder, ctx);
+		if (ret)
+			return ret;
+	}
 
 	/*
 	 * Clearing NACK and defer counts to get their exact values
@@ -5130,19 +5135,8 @@  intel_dp_detect(struct drm_connector *connector,
 		      connector->base.id, connector->name);
 
 	/* If full detect is not performed yet, do a full detect */
-	if (!intel_dp->detect_done) {
-		struct drm_crtc *crtc;
-		int ret;
-
-		crtc = connector->state->crtc;
-		if (crtc) {
-			ret = drm_modeset_lock(&crtc->mutex, ctx);
-			if (ret)
-				return ret;
-		}
-
+	if (!intel_dp->detect_done)
 		status = intel_dp_long_pulse(intel_dp->attached_connector, ctx);
-	}
 
 	intel_dp->detect_done = false;