6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jani Nikula [ Upstream commit 005771c18c5b2c98cb4e7517661aea460990fd3f ] The loop in intel_dp_check_mst_status() keeps servicing interrupts originating from the sink without bound. Add an upper bound to the new interrupts occurring during interrupt processing to not get stuck on potentially stuck sink devices. Use arbitrary 32 tries to clear incoming interrupts in one go. Discovered using AI-assisted static analysis confirmed by Intel Product Security. Note: The condition likely pre-dates the commit in the Fixes: tag, but this is about as far back as a backport has any chance of succeeding. Before that, the retry had a goto. Reported-by: Martin Hodo Fixes: 3c0ec2c2d594 ("drm/i915: Flatten intel_dp_check_mst_status() a bit") Cc: stable@vger.kernel.org # v5.8+ Cc: Ville Syrjälä Cc: Imre Deak Reviewed-by: Imre Deak Link: https://patch.msgid.link/20260625142204.1078287-1-jani.nikula@intel.com Signed-off-by: Jani Nikula (cherry picked from commit b4ea5272133059acb493cc36599071a9e852ec2e) Signed-off-by: Rodrigo Vivi Signed-off-by: Sasha Levin --- drivers/gpu/drm/i915/display/intel_dp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 63c335d3d9ce8..b1ba117cfce86 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -5202,10 +5202,11 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp) struct intel_encoder *encoder = &dig_port->base; bool link_ok = true; bool reprobe_needed = false; + int tries = 33; drm_WARN_ON_ONCE(&i915->drm, intel_dp->mst.active_links < 0); - for (;;) { + while (--tries) { u8 esi[4] = {}; u8 ack[4] = {}; @@ -5248,6 +5249,11 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp) if (!link_ok || intel_dp->link.force_retrain) intel_encoder_link_check_queue_work(encoder, 0); + if (!tries) { + drm_dbg_kms(&i915->drm, "DPRX ESI not clearing, device may be stuck\n"); + reprobe_needed = true; + } + return !reprobe_needed; } -- 2.53.0