Re: [PATCH v2 1/3] drm/i915: Reuse the aux_domain cached

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 05, 2018 at 12:25:50PM -0800, José Roberto de Souza wrote:
> intel_dp_detect() caches the aux_domain in the beginning of the
> function as it is used twice, so lets also use it as the aux_domain
> don't change in runtime by jumping to the end of function when
> retrain the link fails.
> 
> v2: jumping to the end of the function instead of just reuse
> aux_domain
> 
> Cc: Imre Deak <imre.deak@xxxxxxxxx>
> Reviewed-by: Imre Deak <imre.deak@xxxxxxxxx>
> Reviewed-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> Signed-off-by: José Roberto de Souza <jose.souza@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 5258c9d654f4..c7814d53f70f 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -5165,13 +5165,9 @@ intel_dp_detect(struct drm_connector *connector,
>  	 * with an IRQ_HPD, so force a link status check.
>  	 */
>  	if (!intel_dp_is_edp(intel_dp)) {
> -		int ret;
> -
> -		ret = intel_dp_retrain_link(encoder, ctx);
> -		if (ret) {
> -			intel_display_power_put(dev_priv,
> -						intel_aux_power_domain(dig_port));
> -			return ret;
> +		if (intel_dp_retrain_link(encoder, ctx)) {
> +			status = connector_status_disconnected;
> +			goto out;

The only way intel_dp_retrain_link() can fail is -EDEADLK, which we
should return then. Not doing that (and calling intel_dp_unset_edid() as
a result) would be anyway an independent change not belonging to this
patch.

Luckily caught by CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y btw.

>  		}
>  	}
>  
> -- 
> 2.19.1
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux