[PATCH 04/20] drm/i915/dp: Handle a tunneling IRQ after acking it
Luca Coelho
luca at coelho.fi
Tue Jul 1 08:47:38 UTC 2025
On Tue, 2025-07-01 at 11:32 +0300, Imre Deak wrote:
> On Tue, Jul 01, 2025 at 11:02:30AM +0300, Luca Coelho wrote:
> > On Thu, 2025-06-26 at 11:20 +0300, Imre Deak wrote:
> > > From: Imre Deak <imre.deak at gmail.com>
> > >
> > > HPD IRQs in general should be handled after acking them. The
> > >
> > > 1. Read IRQ register (read DP_DEVICE_SERVICE_IRQ_VECTOR,
> > > DP_LINK_SERVICE_IRQ_VECTOR_ESI0)
> > > 2. Handle IRQ
> > > 3. Ack IRQ (write DP_DEVICE_SERVICE_IRQ_VECTOR,
> > > DP_LINK_SERVICE_IRQ_VECTOR_ESI0)
> > >
> > > sequence would miss a new interrupt triggered after 2. and before 3.,
> > > since the flag set in the IRQ register for this interrupt would be
> > > cleared in step 3.
> > >
> > > Fix the above by handling the IRQ after acking it.
> > >
> > > Signed-off-by: Imre Deak <imre.deak at gmail.com>
> > > ---
> > > drivers/gpu/drm/i915/display/intel_dp.c | 25 +++++++++++--------------
> > > 1 file changed, 11 insertions(+), 14 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> > > index 285cd9a5d4a7b..453416b9e9bec 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> > > @@ -5099,17 +5099,10 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
> > >
> > > drm_dbg_kms(display->drm, "DPRX ESI: %4ph\n", esi);
> > >
> > > - ack[3] |= esi[3] & LINK_STATUS_CHANGED;
> > > + ack[3] |= esi[3] & (LINK_STATUS_CHANGED | DP_TUNNELING_IRQ);
> > >
> > > intel_dp_mst_hpd_irq(intel_dp, esi, ack);
> > >
> > > - if (esi[3] & DP_TUNNELING_IRQ) {
> > > - if (drm_dp_tunnel_handle_irq(display->dp_tunnel_mgr,
> > > - &intel_dp->aux))
> > > - reprobe_needed = true;
> > > - ack[3] |= DP_TUNNELING_IRQ;
> > > - }
> > > -
> > > if (mem_is_zero(ack, sizeof(ack)))
> > > break;
> >
> > What happens if we ack the interrupt, but end up not handling it, e.g.
> > if mem_is_zero() returns true here?
>
> This is an optimization in case of ack[] having no bits set (and also to
> break from the loop acking->handling IRQs). I.e. if ack[] is zero the
> AUX write to ack IRQs in intel_dp_ack_sink_irq_esi() can be skipped,
> since no IRQ needs to be acked and then also no IRQ needs to be handled.
Okay, makes sense.
Reviewed-by: Luca Coelho <luciano.coelho at intel.com>
--
Cheers,
Luca.
More information about the Intel-gfx
mailing list