Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Luca Coelho <luca@coelho.fi>
Cc: <intel-gfx@lists.freedesktop.org>,
	<intel-xe@lists.freedesktop.org>,
	"Imre Deak" <imre.deak@gmail.com>
Subject: Re: [PATCH 04/20] drm/i915/dp: Handle a tunneling IRQ after acking it
Date: Tue, 1 Jul 2025 11:32:13 +0300	[thread overview]
Message-ID: <aGOdDXY7Z54zxtib@ideak-desk> (raw)
In-Reply-To: <d6bbc8ebfc0e5948d271cca3e1dbe736b611e3e0.camel@coelho.fi>

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@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@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.

> >  
> > @@ -5121,6 +5114,10 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
> >  
> >  		if ((ack[3] & LINK_STATUS_CHANGED) || intel_dp->link.force_retrain)
> >  			intel_dp_check_link_state(intel_dp);
> > +
> > +		if ((ack[3] & DP_TUNNELING_IRQ) &&
> > +		    drm_dp_tunnel_handle_irq(display->dp_tunnel_mgr, &intel_dp->aux))
> > +			reprobe_needed = true;
> >  	}
> >  
> >  	return !reprobe_needed;
> > @@ -5423,18 +5420,18 @@ static bool intel_dp_check_link_service_irq(struct intel_dp *intel_dp)
> >  			      DP_LINK_SERVICE_IRQ_VECTOR_ESI0, &val) != 1 || !val)
> >  		return false;
> >  
> > -	if ((val & DP_TUNNELING_IRQ) &&
> > -	    drm_dp_tunnel_handle_irq(display->dp_tunnel_mgr,
> > -				     &intel_dp->aux))
> > -		reprobe_needed = true;
> > -
> >  	if (drm_dp_dpcd_writeb(&intel_dp->aux,
> >  			       DP_LINK_SERVICE_IRQ_VECTOR_ESI0, val) != 1)
> > -		return reprobe_needed;
> > +		return false;
> >  
> >  	if (val & HDMI_LINK_STATUS_CHANGED)
> >  		intel_dp_handle_hdmi_link_status_change(intel_dp);
> >  
> > +	if ((val & DP_TUNNELING_IRQ) &&
> > +	    drm_dp_tunnel_handle_irq(display->dp_tunnel_mgr,
> > +				     &intel_dp->aux))
> > +		reprobe_needed = true;
> > +
> >  	return reprobe_needed;
> >  }
> >  
> 
> --
> Cheers,
> Luca.

  reply	other threads:[~2025-07-01  8:32 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-26  8:20 [PATCH 00/20] drm/i915/dp: Fix few SST HPD IRQ handling issues Imre Deak
2025-06-26  8:20 ` [PATCH 01/20] drm/i915/dp_mst: Reprobe connector if the IRQ ESI read failed Imre Deak
2025-06-27  7:42   ` Luca Coelho
2025-06-26  8:20 ` [PATCH 02/20] drm/i915/dp_mst: Verify the link status always the same way Imre Deak
2025-06-26  8:31   ` Jani Nikula
2025-06-27 15:19     ` Imre Deak
2025-07-03 11:14       ` Luca Coelho
2025-06-26  8:20 ` [PATCH 03/20] drm/i915/dp_mst: Reuse intel_dp_check_link_state() in the HPD IRQ handler Imre Deak
2025-07-01  7:50   ` Luca Coelho
2025-06-26  8:20 ` [PATCH 04/20] drm/i915/dp: Handle a tunneling IRQ after acking it Imre Deak
2025-07-01  8:02   ` Luca Coelho
2025-07-01  8:32     ` Imre Deak [this message]
2025-07-01  8:47       ` Luca Coelho
2025-06-26  8:20 ` [PATCH 05/20] drm/i915/dp: Handle the RX_CAP_CHANGED HPD IRQ Imre Deak
2025-07-01  8:03   ` Luca Coelho
2025-07-01 10:30     ` Imre Deak
2025-07-03 11:16       ` Luca Coelho
2025-06-26  8:20 ` [PATCH 06/20] drm/i915/dp: Handle the DOWNSTREAM_PORT_STATUS_CHANGED event Imre Deak
2025-07-01  8:52   ` Luca Coelho
2025-06-26  8:20 ` [PATCH 07/20] drm/i915/dp: Don't clobber the encoder state in the HPD IRQ handler Imre Deak
2025-07-01  8:56   ` Luca Coelho
2025-06-26  8:20 ` [PATCH 08/20] drm/i915/dp: Remove the device service IRQ handling from connector detect Imre Deak
2025-07-01  9:00   ` Luca Coelho
2025-06-26  8:20 ` [PATCH 09/20] drm/i915/dp: Fix the device service IRQ DPCD_REV check Imre Deak
2025-07-01  9:01   ` Luca Coelho
2025-06-26  8:20 ` [PATCH 10/20] drm/i915/dp: Fix the link " Imre Deak
2025-07-01  9:12   ` Luca Coelho
2025-06-26  8:20 ` [PATCH 11/20] drm/i915/dp: Reprobe connector if getting/acking device IRQs fails Imre Deak
2025-06-26  9:12   ` Jani Nikula
2025-06-26  9:35     ` Imre Deak
2025-06-26 10:23       ` Jani Nikula
2025-06-26 10:43         ` Imre Deak
2025-06-26 10:46           ` Jani Nikula
2025-06-26 10:56             ` Imre Deak
2025-07-03 11:28               ` Luca Coelho
2025-07-03 11:43                 ` Imre Deak
2025-07-07 10:05                   ` Luca Coelho
2025-06-26  8:20 ` [PATCH 12/20] drm/i915/dp: Reprobe connector if getting/acking link service " Imre Deak
2025-07-03 11:37   ` Luca Coelho
2025-06-26  8:20 ` [PATCH 13/20] drm/i915/dp: Return early if getting/acking device " Imre Deak
2025-07-03 11:59   ` Luca Coelho
2025-06-26  8:20 ` [PATCH 14/20] drm/i915/dp: Return early if getting/ackink link " Imre Deak
2025-07-03 12:29   ` Luca Coelho
2025-06-26  8:20 ` [PATCH 15/20] drm/i915/dp: Read/ack sink count and sink IRQs for SST as it's done for MST Imre Deak
2025-07-03 13:02   ` Luca Coelho
2025-07-03 13:14     ` Imre Deak
2025-07-03 13:24       ` Luca Coelho
2025-06-26  8:20 ` [PATCH 16/20] drm/i915/dp: Print debug message for a sink connected off request Imre Deak
2025-07-03 13:03   ` Luca Coelho
2025-06-26  8:20 ` [PATCH 17/20] drm/i915/dp: Check SST link status while handling link service IRQs Imre Deak
2025-07-03 13:05   ` Luca Coelho
2025-06-26  8:20 ` [PATCH 18/20] drm/i915/dp_mst: Reuse intel_dp_handle_link_service_irq() Imre Deak
2025-07-03 13:07   ` Luca Coelho
2025-06-26  8:20 ` [PATCH 19/20] drm/i915/dp: Ack only the handled device service IRQs Imre Deak
2025-07-03 13:14   ` Luca Coelho
2025-07-03 13:18     ` Imre Deak
2025-07-03 13:27       ` Imre Deak
2025-07-03 13:34         ` Luca Coelho
2025-06-26  8:20 ` [PATCH 20/20] drm/i915/dp: Ack only the handled link " Imre Deak
2025-07-03 13:18   ` Luca Coelho
2025-06-26  8:37 ` ✓ CI.KUnit: success for drm/i915/dp: Fix few SST HPD IRQ handling issues Patchwork
2025-06-26  8:55 ` ✗ CI.checksparse: warning " Patchwork
2025-06-26  9:18 ` ✓ Xe.CI.BAT: success " Patchwork
2025-06-27  8:21 ` ✗ Xe.CI.Full: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aGOdDXY7Z54zxtib@ideak-desk \
    --to=imre.deak@intel.com \
    --cc=imre.deak@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=luca@coelho.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox