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=1796382180; b=R4xR308n/jBQPn0mG1CtsgQRsrNzLj8Vhg0y1cyN9aRQBMgoKVO3JzR8l4wwihu4No9f Ff1A+tGaZlsnG0pmYoF3rmCmR7xIWl0LzM0dDDlESMv1bca6IZLFSad25XWqkjfS5gweO lewyQceoEoOt4cB/cH1WmS/6MiVTIk4YfpvczTWaOIuDtOnemkw3L3F9fmBU6h1rGlZ+8 0WSexYJet+G2uh3O9AxULp3tZ8CjgdfbhzpUS7RSoawYiHwkPwQ5EqV2/uEGF56qmuS3x c8O79f1vil1ufL38q/FtOCt/X6rS8pYq3h6ILZGlxGOGYb8OUqA1QrkdPI4AmZIG19Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382180; 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-Transfer-Encoding; bh=HqhhsV3haJyG/o/S83hBOi0a2bvzrXc+zh0f8W+pR98=; b=r+E8CBW3nTpdlmdNd27U7Zd6pbwZWFjmSKMEkj2AoFsrcV+Duoz9kFQxqradb/kmbVzG POoPiiVcQuJ90q8wCs2r04t0TmQbezGTHlldprfyiH42ZBPneGZYoZ2I8dAITX9g5S0BR le3NdNNeVmvLLXJIQEKdx0QLnvxhcWiuFGys61prd81ra7t2MQpedtQwdOzyKqAXyq5oK ZYM4m0D/3Rrz3vnCmsbW2mi4+Fk17HG6QlQQrMUx/Bm2QPlG1/+FKZGJ6SUkJ1anWljC0 9r/aYMg6Vqs0k1PGjwHsbQwzPnPWK94OFNWJcqq42/t0fa5H66sNO+kO6ozKWNzqqQg== 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=ewQ14tYg; 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 21212606A322; Fri, 4 Dec 2026 11:03:00 +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=ewQ14tYg Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8ACB11F000C2; Fri, 4 Dec 2026 11:02:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382180; bh=HqhhsV3haJyG/o/S83hBOi0a2bvzrXc+zh0f8W+pR98=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ewQ14tYgm+tIodIihE799S0JjS8F58AKDLvWYyfwkcXP/ylhXJFWtjGOYnCiWqUiN bPl4ck3Err1ZFevmC0MwUo+k6zdVtc/sMyhDqi55kaQZJ2JrkG1G9hE0JyiGLohvEF AO4x/EX/7ScNOD73g10hy6p+wPwoosN4Vdlsdfzg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, John Williams , Shigeaki Asai , Neil Armstrong Subject: [PATCH 6.18 343/703] drm/meson: encoder_dsi: load ENCL gamma table while ENCL is disabled Date: Fri, 4 Dec 2026 19:04:02 +0900 Message-ID: <20261204100636.912316451@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-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shigeaki Asai commit 0cb7f6d9e4b1d0a411b628ccf78695ad41c66570 upstream. meson_encoder_dsi_atomic_enable() programmed the ENCL gamma LUT right after meson_venc_mipi_dsi_mode_set(), i.e. while the ENCL timing generator was already running (ENCL_VIDEO_EN=1). Writing the LUT during active video stalls the hardware: L_GAMMA_CNTL_PORT WR_RDY/ADR_RDY deassert and the ENCL line counter (ENCL_INFO_READ) freezes, so every remaining write times out (~8s total at boot) and the panel ends up with a corrupted gamma table (wrong colors). Instrumented boots on the ODROID-GO Ultra (S922X) show: failing: start: VIDEO_EN=1 INFO 0000001a->002d0000 GAMMA_CNTL=00000030 stall: INFO 002d0000->002d0000 GAMMA_CNTL=00000000 (VID_CLK_CNTL2 / VIID_CLK_CNTL / VIID_CLK_DIV unchanged, i.e. the ENCL clock is still running) fixed: start: VIDEO_EN=0 INFO 00000000->00000000 GAMMA_CNTL=00000030 no stall, no timeout Whether it failed depended only on timing, which is why enabling lock debugging (LOCKDEP etc.) appeared to "fix" it most of the time. It happens regardless of the bootloader (mainline or Hardkernel vendor U-Boot). The function already writes ENCL_VIDEO_EN=0 right afterwards before re-enabling the encoder, so simply move meson_encl_load_gamma() after that write. This matches the order used by the vendor U-Boot's own LCD driver, which never times out. Tested on the ODROID-GO Ultra with mainline U-Boot: 5 cold boots + 3 warm reboots, no timeouts, correct colors, LOCKDEP disabled. Fixes: 42dcf15f901c ("drm/meson: add DSI encoder") Cc: stable@vger.kernel.org Tested-by: John Williams Signed-off-by: Shigeaki Asai Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patch.msgid.link/20261004-meson-gamma-v1-1-6347558e2bb3@docomonet.jp Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/meson/meson_encoder_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/meson/meson_encoder_dsi.c +++ b/drivers/gpu/drm/meson/meson_encoder_dsi.c @@ -66,9 +66,9 @@ static void meson_encoder_dsi_atomic_ena /* ENCL clock setup is handled by CCF */ meson_venc_mipi_dsi_mode_set(priv, &crtc_state->adjusted_mode); - meson_encl_load_gamma(priv); writel_relaxed(0, priv->io_base + _REG(ENCL_VIDEO_EN)); + meson_encl_load_gamma(priv); writel_bits_relaxed(ENCL_VIDEO_MODE_ADV_VFIFO_EN, ENCL_VIDEO_MODE_ADV_VFIFO_EN, priv->io_base + _REG(ENCL_VIDEO_MODE_ADV));