]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/dp: Handle a tunneling IRQ after acking it
authorImre Deak <imre.deak@intel.com>
Wed, 25 Feb 2026 16:46:02 +0000 (18:46 +0200)
committerImre Deak <imre.deak@intel.com>
Tue, 3 Mar 2026 15:49:03 +0000 (17:49 +0200)
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.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260225164618.1261368-5-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_dp.c

index 8f0309c5c91f4976bd9c8ca2e6055df5b678c5d2..2e7a4df48afa7ebd3b20f31d868609e101ca7f84 100644 (file)
@@ -5491,17 +5491,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;
 
@@ -5513,6 +5506,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;
@@ -5815,18 +5812,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;
 }