From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E81015442C; Thu, 3 Jul 2025 15:07:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751555222; cv=none; b=LvL28bdvgIEnOlM54OR0Q2jT724qhfX6zTafOzGxKxKfSHpxTEm5dXsnzQy4YXdprTWPcMTlZX9FwW5lqbPRcnyTXm8DrjsDfMj5ngLp+uXGkkMUXpFYIWe/yOQ1ooie9+R1ZVXlXbMzQfXQS9zHYJy4fdSt7G1A/LXEC0Nh52w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751555222; c=relaxed/simple; bh=P30JtPHa2m6AHU8StY/RsZ1ss/lzHwdMTOS2qKVDYZg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XdmpoLD+lvZQSGxZP2l7ZIrpezO5UQyIAzC57Wt8qwNQiGBUK+l32HIpELRRYtJ0/MTzdtXrqky+4o2HNyhGDst945TKlj8izMtATTlZD7bYw3YaB5plyFL96i28n6VLTP7cscJ9CcE+Tx26kYFnSqDeJVAx/eP5sQUbZhDiyvY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kuR2vGQE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="kuR2vGQE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7C70C4CEE3; Thu, 3 Jul 2025 15:07:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1751555222; bh=P30JtPHa2m6AHU8StY/RsZ1ss/lzHwdMTOS2qKVDYZg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kuR2vGQEWd0hD+gfDKQus0cB4GhsOkXaC1majA5ejlCgP+RhWhYjGQ/DkvFicPgLi 2BDfhA1EOEMsg2XMa5OkhHufKqUoacJ7ZNibZsrBqYldic680N+xX1onIB5HS7BH9Z LR0ZEQ4iHEQ7UskxcXRPo//30YCBpGkzyNJ8oEFI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mika Westerberg , Imre Deak , Joonas Lahtinen Subject: [PATCH 6.15 213/263] drm/i915/dp_mst: Work around Thunderbolt sink disconnect after SINK_COUNT_ESI read Date: Thu, 3 Jul 2025 16:42:13 +0200 Message-ID: <20250703144012.931381973@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250703144004.276210867@linuxfoundation.org> References: <20250703144004.276210867@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Imre Deak commit 9cb15478916e849d62a6ec44b10c593b9663328c upstream. Due to a problem in the iTBT DP-in adapter's firmware the sink on a TBT link may get disconnected inadvertently if the SINK_COUNT_ESI and the DP_LINK_SERVICE_IRQ_VECTOR_ESI0 registers are read in a single AUX transaction. Work around the issue by reading these registers in separate transactions. The issue affects MTL+ platforms and will be fixed in the DP-in adapter firmware, however releasing that firmware fix may take some time and is not guaranteed to be available for all systems. Based on this apply the workaround on affected platforms. See HSD #13013007775. v2: Cc'ing Mika Westerberg. Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13760 Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14147 Cc: Mika Westerberg Cc: stable@vger.kernel.org Reviewed-by: Mika Westerberg Signed-off-by: Imre Deak Link: https://lore.kernel.org/r/20250519133417.1469181-1-imre.deak@intel.com (cherry picked from commit c3a48363cf1f76147088b1adb518136ac5df86a0) Signed-off-by: Joonas Lahtinen Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/display/intel_dp.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -4457,6 +4457,23 @@ intel_dp_mst_disconnect(struct intel_dp static bool intel_dp_get_sink_irq_esi(struct intel_dp *intel_dp, u8 *esi) { + struct intel_display *display = to_intel_display(intel_dp); + + /* + * Display WA for HSD #13013007775: mtl/arl/lnl + * Read the sink count and link service IRQ registers in separate + * transactions to prevent disconnecting the sink on a TBT link + * inadvertently. + */ + if (IS_DISPLAY_VER(display, 14, 20) && !display->platform.battlemage) { + if (drm_dp_dpcd_read(&intel_dp->aux, DP_SINK_COUNT_ESI, esi, 3) != 3) + return false; + + /* DP_SINK_COUNT_ESI + 3 == DP_LINK_SERVICE_IRQ_VECTOR_ESI0 */ + return drm_dp_dpcd_readb(&intel_dp->aux, DP_LINK_SERVICE_IRQ_VECTOR_ESI0, + &esi[3]) == 1; + } + return drm_dp_dpcd_read(&intel_dp->aux, DP_SINK_COUNT_ESI, esi, 4) == 4; }