From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796383018; b=WlhTudTHSQESkL4rSNWfcWNi1zPqFPKhFA0egIRAVS3Q4JfU4CldtqxQwaxODfUI1rWz hiMR2sSGFczFsxaDbpXdvxOzJnSrYSWWMzMXQ/qUaMWQVcS5VupK3pPXIe8aiw4kUku1l /uIk9GrQKIrlcEIlJ9YV0zBMjLPjF5rb9NxfHCtRiNTU3nv1PvJY8UvDtLOQ0kx/prH+6 Htvlmh4oz7hADkyx5Iu02HJI5oaB89zQrtzVVsT8VpK8qgKEMi208ErWX2kqXK00LbeyW 4NBA307fmP/xxwoZ3t38Eeud38RadJHvp45B8EIDtUOiF0Rl8V228c/I4ucyyhATaOQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383018; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=+tTMPzgh7Cw2jdONetfiaB3kVNHmECCNau0RwziCtFU=; b=NBLFdxZR3H6f2ci4sgOLtqMxr4v6Amj13BFk69Fp/6yaoklNd6s4wnFkHMko/pdI9SFO te6vIOJX0cpzMcTAi9uB7bXhiEmZV+W9zMzDYJ0Trdjc30IYII9/aPxNwjeICGHBsAAh+ HwgkBJB4Jliol6wbL+K6lr2r1AzQiswdDmxBVnbKK/Cyv99BW5wNty7q2k0RgfiKTfGfY fPQ+bAxMZTRXkeTx6vCvd1gp3jaWGk1aPx6bMomHgY2BKEkQa+/zmGhNQaqCGApB5Y49m WgV496uDnbIzntmhaUNqRGChhCAJc8htT2+LQDS21sHZr8awxN6q8unKEqZnMucMOkQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=X2IoFAMB; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65B25606A332; Fri, 4 Dec 2026 11:16:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=X2IoFAMB Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAFBF1F00897; Fri, 4 Dec 2026 11:16:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383018; bh=+tTMPzgh7Cw2jdONetfiaB3kVNHmECCNau0RwziCtFU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=X2IoFAMBkqD29ey+str2w9t7BvhjdzFB1pXKPLXh5l37/wPS6n81sN5xznYdyYeqY E27Z7DX/7rJXogpNyooYCrwggKo5Vfk6qUtzvAOPTfawgELhcpN2GhMK+rPMED3JIk Vs/FqUz885egoLggyS6Ce8RtKg8wqw1o2TkvfFA4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Hanson Wang , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Joonas Lahtinen , Sasha Levin Subject: [PATCH 6.18 692/703] drm/i915/dsb: Realign GOSUB only for QW slots 6 and 7 Date: Fri, 4 Dec 2026 19:09:51 +0900 Message-ID: <20261204100646.246411447@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hanson Wang [ Upstream commit 715f145f6204363a50853eb15719dc860db0bc01 ] intel_dsb_gosub_align() moves free_pos to the next cacheline unconditionally, but only clears the skipped bytes when at most two QW slots remain. Wa_16024917128 forbids GOSUB in slots 6 and 7 only. A larger gap is still executed. A Panther Lake DSB dump showed nonzero data in that gap, with the tail at 0x58 and GOSUB at 0x80. Advance free_pos only when the instruction would land in slot 6 or 7, and fill that gap with NOPs. Emit GOSUB in place for every other slot. intel_dsb_align_tail() still clears the rest of the cacheline. Update free_pos inside the existing gap check in intel_dsb_align_tail() as well, so the two helpers keep the same shape. Fixes: 2c41d62f6fb1 ("drm/i915/dsb: Implement intel_dsb_gosub()") Cc: stable@vger.kernel.org # v6.17+ Signed-off-by: Hanson Wang Signed-off-by: Ville Syrjälä Link: https://patch.msgid.link/20261106102315.1361645-1-hanson.wang@ugreen.com (cherry picked from commit a2f5df6c5468b4f65e58c4125bba3f0e3cdc6aa1) Signed-off-by: Joonas Lahtinen [ sashal: Replaced the upstream dsb_buffer_fill(dsb, ...) calls with intel_dsb_buffer_memset(&dsb->dsb_buf, ...) in both align functions, since this tree has a different DSB buffer helper API. ] Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/display/intel_dsb.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) --- a/drivers/gpu/drm/i915/display/intel_dsb.c +++ b/drivers/gpu/drm/i915/display/intel_dsb.c @@ -538,11 +538,11 @@ static void intel_dsb_align_tail(struct tail = dsb->free_pos * 4; aligned_tail = ALIGN(tail, CACHELINE_BYTES); - if (aligned_tail > tail) + if (aligned_tail > tail) { intel_dsb_buffer_memset(&dsb->dsb_buf, dsb->free_pos, 0, aligned_tail - tail); - - dsb->free_pos = aligned_tail / 4; + dsb->free_pos = aligned_tail / 4; + } } static void intel_dsb_gosub_align(struct intel_dsb *dsb) @@ -557,12 +557,16 @@ static void intel_dsb_gosub_align(struct /* * Wa_16024917128 * "Ensure GOSUB is not placed in cacheline QW slot 6 or 7 (numbered 0-7)" + * + * Move to the next cacheline only for those two slots. The skipped + * bytes stay in the programmed range, so fill them with NOPs. Any + * other slot can take the GOSUB directly. */ - if (aligned_tail - tail <= 2 * 8) + if (aligned_tail - tail <= 2 * 8) { intel_dsb_buffer_memset(&dsb->dsb_buf, dsb->free_pos, 0, aligned_tail - tail); - - dsb->free_pos = aligned_tail / 4; + dsb->free_pos = aligned_tail / 4; + } } void intel_dsb_gosub(struct intel_dsb *dsb,