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=1796386574; b=dYpmiuxNt5WY72NEHRDb+FjmoedET7m4NTkhJvfBR+hSkhxRCKdq0iBIsLzjm/Qt2esJ D8uv+s+BmlD23Om/EQYt7pVOIGFtJmxFeIQH350djwwrrsfd4Bfw5I0Iyk8VSt4MzxJhL d1quKmBTJ54knTWG547a37qRyN0/McEnzQnda9y5A1CxAzSBO0GTE6fEjFeVNpMLMk0vx KclpWZIdXvNlThvacCGVxkbC0ZvfNebL0X4ZyLrAcGM/vitDxMsc4q/Q0gW2jL8q6CTfO c7htI+7bgYEGbMwTOLD0aAQ8ssqf5HrRaynIjV19sQfIO2WktdJL3Tli24ln+UWBI/A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386574; 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=Adjf+fmC0XMtPeVlyGEsUJnTNQoCFfGzHZwKzMqnr6k=; b=e7t19NfplbKpoWcGE5ufPws7mxFrLsUEXuTfpnX1kjxVox6Z+m6i48I2MP9p7/WiYdfd anvCWANnrlMlXegD7LnHSdW6wKt/uV2Js6Dbcm0Qy1ZQ7iJGvFBuwtB3H3jtwhBFqQt3c b8BuJX181rVLodzw8PuJyhKJSA2XAZprZKacFEVMaxNZ/UkA6UM7S4QAkGSGg10LdgDOy Q/RwSGcAQADibC2FpTdBpv3NGsNdZV+6JxGqWaxbZLrzzBYMRAmd7/lsL4qn4fKljbkaq Nzi9eHMPHmKz4EjRq7lzcyFSV4O2jEEn4z8gZQXUGX1nuGUU8a/1QQFnY61EmRY0+Mg== 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="QdQvo/iq"; 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 90E31606A322; Fri, 4 Dec 2026 12:16:14 +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=QdQvo/iq Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06C4F1F00939; Fri, 4 Dec 2026 12:16:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386574; bh=Adjf+fmC0XMtPeVlyGEsUJnTNQoCFfGzHZwKzMqnr6k=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QdQvo/iqkRHXuXw7RMk4E0vIz6jKmnLOsZRTqBomW7vxkbqLI5wGOVeBVoEubACs1 Utw2xOln3Zb8HRC8L+7ncy+o0GzAQQqE+hhAlWvPpeGvsF6+SgZehHtz2E9ZGKLqob Y+oOMuRiACNWlnePTDdk4Ra2oeb/IPW+Yb6a9VGU= 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.6 0984/1167] drm/meson: encoder_dsi: load ENCL gamma table while ENCL is disabled Date: Fri, 4 Dec 2026 19:06:51 +0900 Message-ID: <20261204100727.830307910@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@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.6-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));