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=1796380616; b=ZxlkJsplFnk3PnK0iVXOVWTG/UDDzOdXeEFC3dvk8HXN4NBD6f7kYGia6ZLc7UZhsYAC naSqiPzNSepRS5Fsj5ho6OOIg+Q3shBPQ0Bl5MWbFJhX1VMldFQ/O645laicOoKoom4ZK +QIxU+fEEbn3cdxYXsTExBHrP7kHxYf+utKk1IqaCgcK9cNvd+0CVXmAzbAFBjP/pWcZC X1NzDGzcET9rxkcZTBLld+4RnxUqfY6oJ3mew05503hdps1kOeZIDsgWQC/SWi9E11EXe 8Mv2NmOQkjPjFrlduTlxdHCYApkXg1gyBrPlNZJwVy2CoLR/lhZcbLCISoAK00pFuvA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380616; 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=jvnEi1N/c7YrdIH8SLd4NvwoeeGLh61K9dtbM9ltaQY=; b=W2W3zoa1PfnEweWs+sWC6MPpFxhEcY4EQfQxE/Gi0BwnTqpVh9KXqSUrCbm9k5YGX8gx YGFtlaOtf3PMdHN3+R27mNQ0iaHnArwdlQfAVaMhIQSxPXtR+u7o/bu6VK2H+X4aIIsB+ 8yMAQE8BfOUcLoGQ0Bj424HKPOdG9BXN2qJE+eda09/kN4nBvhzPHmIPKDRv3msKterWV MU2o+FsycP1KJNpFb9hIAfLc8S+W3Dg5fZ2PkP9j0XnogA/q2PZ9g8fcqd8OrTuGPktKk 4HGYOthZfWEbxesp9NJzkesIyOB5tJQfHTIfm7rahkQoNhbis21XF4MVnfJ25IHq5Yg== 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=hTxRM6c2; 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 21AC1606A682; Fri, 4 Dec 2026 10:36:56 +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=hTxRM6c2 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B2691F000CE; Fri, 4 Dec 2026 10:36:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380616; bh=jvnEi1N/c7YrdIH8SLd4NvwoeeGLh61K9dtbM9ltaQY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hTxRM6c28s+6z8wPEXgtgI0hJE7drV6mZSI6UZ6CspII+thUP8F2oybO8/DYNvVa6 gJq8x//GD4FszELdZBBb/hiHAhCMEe8KTEeqCg3OM60u1eGkYWrwbqp2/n90wXIK0e 1E0qCQby1NiHyu+l9YNEVdogQTMjg1oV2J6ecI3o= 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 7.3 349/742] drm/meson: encoder_dsi: load ENCL gamma table while ENCL is disabled Date: Fri, 4 Dec 2026 19:03:33 +0900 Message-ID: <20261204100644.341021835@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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 @@ -65,9 +65,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));