[PATCH 13/20] drm/i915/dp: Return early if getting/acking device service IRQs fails

Luca Coelho luca at coelho.fi
Thu Jul 3 11:59:12 UTC 2025


On Thu, 2025-06-26 at 11:20 +0300, Imre Deak wrote:
> If getting/acking the device service IRQs fail, the short HPD handler
> should bail out, falling back to a full connector detection as in case
> of any AUX access failures during the HPD handling. Do this by
> separating the getting/acking and handling steps of the IRQs.
> 
> Signed-off-by: Imre Deak <imre.deak at intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 35 ++++++++++++++++---------
>  1 file changed, 23 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 66db426b4aca1..cfbe7c6f896ab 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -5393,31 +5393,39 @@ void intel_dp_check_link_state(struct intel_dp *intel_dp)
>  	intel_encoder_link_check_queue_work(encoder, 0);
>  }
>  
> -static bool intel_dp_check_device_service_irq(struct intel_dp *intel_dp)
> +static bool intel_dp_get_and_ack_device_service_irq(struct intel_dp *intel_dp, u8 *irq_mask)

I think these names are still a bit confusing, so adding short comment
explaining what the bool is, as Jani suggested,is a good thing.


>  {
> -	struct intel_display *display = to_intel_display(intel_dp);
>  	u8 val;
>  
> +	*irq_mask = 0;
> +
>  	if (drm_dp_dpcd_readb(&intel_dp->aux,
>  			      DP_DEVICE_SERVICE_IRQ_VECTOR, &val) != 1)
> -		return true;
> +		return false;
>  
>  	if (!val)
> -		return false;
> +		return true;
>  
>  	if (drm_dp_dpcd_writeb(&intel_dp->aux, DP_DEVICE_SERVICE_IRQ_VECTOR, val) != 1)
> -		return true;
> +		return false;
>  
> -	if (val & DP_AUTOMATED_TEST_REQUEST)
> +	*irq_mask = val;
> +
> +	return true;
> +}
> +
> +static void intel_dp_handle_device_service_irq(struct intel_dp *intel_dp, u8 irq_mask)

Same for this function.

With these changes:

Reviwed-by: Luca Coelho <luciano.coelho at intel.com>

--
Cheers,
Luca.


More information about the Intel-gfx mailing list