[Intel-gfx] [PATCH v2 1/3] drm/i915: Reuse the aux_domain cached
Imre Deak
imre.deak at intel.com
Tue Nov 6 11:32:26 UTC 2018
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 at intel.com>
> Reviewed-by: Imre Deak <imre.deak at intel.com>
> Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
> ---
> 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
>
More information about the Intel-gfx
mailing list