From patchwork Fri Nov 20 15:37:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman verschooten X-Patchwork-Id: 4198 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id BAC231C5E3E for ; Fri, 20 Nov 2026 16:38:10 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=octarion.eu; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-27927-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-27927-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 78005694B8 for ; Fri, 20 Nov 2026 15:38:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795189089; b=fskQDlGnjsiEcamPo4zFSNCZ15OBVS1s38MeMkw776HkXkGYLtz/qS94PPa3Sw3unJvZ roX465IealZG38kJ9mPlZkgogJjZGdQrSR8IRXMu/E1JdzaWF2IopBUonubok4lsxsMA2 5Mb6rIA8fvtq91aUUtP8qRPUZRhmvIFDUch8VaGHlnw35OqFUwB7l6thgWD5U1SjVdZZI Vun1oGsJVfSmcpXsWDeBagjZnZUbJ9MVSKa1LB4bppUcdtH12vw8NfZzQcsgRfHiPqUQH bXA4J7oy9laeWJu613IGNNe8Z/lUORuH8EIoJEnR/4aZ/gfj/JnG9g+X8T/mcyLL/jw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795189089; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Transfer-Encoding; bh=KFSasBaQ8OA2KKDICReL5AyVNlfF5o5HYocfZ1mZcWk=; b=prN0RRDDVIkuj+8HNTYUrWllykS1gXyxP5DYyEIkT+LNYsW4nXSHSCJ+yhk86Q7AeawR p0cULkRMFMQua7/J4NaWcvbL4DC046sdyB6fZGeH7NS6yL/qlIwLnAmzB+tgU07c3NO1n AiSFceRCxH9l8A71zPVex1Tq7fA2aF7pPq1GUdGRpN9s8zvvF27o+YwtOap/wF2O50wH3 YhbvP9Djm4ScNrbVj7AuuNEsLZ13IU2yDYfFQ9jTJdtG/7uN+GiSiOZKHpSn7qn+zgweH 6C2WvWofYyMWKXX3tZiddUPzC0QzPjpZxbUkSYpQSuryzUj6bHllbU+NEu6LiF2svrw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=octarion.eu header.i=@octarion.eu header.a=rsa-sha256 header.s=mail header.b=kMxL3zg1; dmarc=pass header.from=octarion.eu; spf=pass smtp.mailfrom=octarion.eu; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4582A606A32A; Fri, 20 Nov 2026 15:38:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=octarion.eu header.i=@octarion.eu header.a=rsa-sha256 header.s=mail header.b=kMxL3zg1 X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=77.73.98.243 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795189089; b=wKiyphSsENoU5NYfx389LPUjqBgRyvHrm7bLjwbLZr7pp14u1zq3Gc72d9TxlQ7C5gyl a8v/pWIPqb8kFndOtu5e6W1lbDTfwLhw1hEDw0q4U+94fB/08buPKMvk5Ncvm0UB0xWKj SNgfRimYJ7qPXOTt/jQ6oHY0P9ySsxEPrnik0PjBnCClq96vpB+TQ6XIXO9Rq48XJWNDC i0vByZiGqOObBN2mMvXs/tWRbLCI+hZgBhpiYEbqrY8GikU6Lq3HSuRZERvELMpia5DLU +pyQyObHdPSjy+P+52hRG7MRV9+uX9Y50eYWcKmmCauiSggJe+xoJsmXGAhky2JQrhw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795189089; h=DMARC-Filter:Received:DKIM-Signature:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=KFSasBaQ8OA2KKDICReL5AyVNlfF5o5HYocfZ1mZcWk=; b=Wpu4jl0flO3T5eN/0kZRvdM9fXgxfr/F+3VT8el3QW8TDP3IHTmqQjkZoVW3xmjHy8RV 3+gLUqxT8I4fSPQjlq0zgJshSoraCUzeSI0s5bhP+75Kp5Bq8Arco8eOPFtHPMPtC4K4T x8DM5WI/FxynmUN5fz1e0FguKJlzAHtQAOFeA7UbP+twhPTQq8U9027xSJSpwTt8eVipp x8RE0Zaxk+vXEYyh8qhdR5xLtcnueT82gaujaVXnTKLl9C+hrWPs8OZE3Xvsnbgg3PEWn sh0K/GsY8diaRoDGaknVqCRlKo1rGPpJ9rGZZedXm1Mg6bZUImxwJ06IZip5yYK017A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=octarion.eu; spf=pass smtp.mailfrom=octarion.eu; dkim=pass header.d=octarion.eu header.i=@octarion.eu header.a=rsa-sha256 header.s=mail header.b=kMxL3zg1; arc=none smtp.remote-ip=77.73.98.243 Received: from mail.octarion.eu (mail.octarion.eu [77.73.98.243]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52694606A325 for ; Fri, 20 Nov 2026 15:38:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 52694606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=octarion.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=octarion.eu Received: from mail.octarion.eu (localhost [127.0.0.1]) by mail.octarion.eu (Postfix) with ESMTP id B35D14AC0C1 for ; Fri, 20 Nov 2026 15:37:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=octarion.eu; s=mail; t=1795189077; h=from:to:subject:date:message-id:mime-version; bh=KFSasBaQ8OA2KKDICReL5AyVNlfF5o5HYocfZ1mZcWk=; b=kMxL3zg1yr5R7HP5w9hCzCdsls68BJkrDbxotdBCYWeAYdzCy+caZF9QvYRb51gXSlkSH/UKkeVS CSQbyJWatmwbDsKXXgHbKsc9L5jDStAhC8tYScviUieqOYGLY2P+gindRa0fPs1C6S//CDpzueFY I6cyGrbWluqsO5rv1gAdyX30nzZXE+zXR++vKoabbT74MK3TdJwrNcIxMb9B6RKQN1h38sT4aBw4 Rj+bkDKR5eUVIwYfuHwsv8bnLmwdi3uoqIhiwE9CD6kfmJcjfhL9wn//M0QrlIsKzOSfbdImAhFK Lj6fBs/rlJvB9w3U69I7l0rUhyDA0d/votFRIg== Received: from localhost.localdomain (unknown [IPv6:2a02:1807:3930:3611:dd78:6350:fd25:20d0]) by mail.octarion.eu (Postfix) with ESMTPSA id F09294AC0B1; Fri, 20 Nov 2026 15:37:56 +0000 (UTC) From: Herman verschooten To: Chen-Yu Tsai , Stephen Boyd Cc: Jernej Skrabec , Samuel Holland , Brian Masney , Jerome Brunet , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Herman verschooten Subject: [PATCH] clk: sunxi-ng: sun6i-a31: Fix LCD CH0 and IEP clock mux widths Date: Fri, 20 Nov 2026 16:37:23 +0100 Message-ID: <20261120153723.85232-1-Herman@octarion.eu> X-Mailer: git-send-email 2.56.1 X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX The source select fields of the LCD0/LCD1 CH0 clocks and the IEP DRC0, DRC1, DEU0 and DEU1 clocks are 3 bits wide (bits 26:24), like those of the BE, FE and MP clocks, but they are described as 2 bits wide. The LCD CH0 clocks have 5 possible parents and the IEP clocks 6 (the same de_parents as BE/FE/MP), so pll-mipi, pll9 and pll10 can never be selected. Worse, if the bootloader left bit 26 set, Linux keeps it when it reparents these clocks, and the register ends up selecting a different or reserved source. This happens on a Modecom FreeTab 8014 tablet, whose vendor bootloader shows its boot logo on the LVDS panel and leaves bit 26 set in both the LCD0 CH0 and the IEP DRC0 clock registers. Linux reparents them to pll-video0-2x and pll-periph-2x by writing only bits 25:24, leaving both registers at the reserved value 0b110: the TCON gets no clock and never raises a vblank interrupt (drm_atomic_helper_wait_for_vblanks() times out, the panel stays dark), and once the TCON clock is fixed by hand, the unclocked DRC0 makes the panel show a flat colour instead of the picture. When the same kernel is started over FEL, where these registers start at zero, the display works. Describe these muxes as 3 bits wide. Fixes: c6e6c96d8fa6 ("clk: sunxi-ng: Add A31/A31s clocks") Assisted-by: claude-opus-5-5 Signed-off-by: Herman verschooten --- drivers/clk/sunxi-ng/ccu-sun6i-a31.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/clk/sunxi-ng/ccu-sun6i-a31.c b/drivers/clk/sunxi-ng/ccu-sun6i-a31.c index bab65cf..0884dc5 100644 --- a/drivers/clk/sunxi-ng/ccu-sun6i-a31.c +++ b/drivers/clk/sunxi-ng/ccu-sun6i-a31.c @@ -551,9 +551,9 @@ static const char * const lcd_ch0_parents[] = { "pll-video0", "pll-video1", "pll-video0-2x", "pll-video1-2x", "pll-mipi" }; static SUNXI_CCU_MUX_WITH_GATE(lcd0_ch0_clk, "lcd0-ch0", lcd_ch0_parents, - 0x118, 24, 2, BIT(31), CLK_SET_RATE_PARENT); + 0x118, 24, 3, BIT(31), CLK_SET_RATE_PARENT); static SUNXI_CCU_MUX_WITH_GATE(lcd1_ch0_clk, "lcd1-ch0", lcd_ch0_parents, - 0x11c, 24, 2, BIT(31), CLK_SET_RATE_PARENT); + 0x11c, 24, 3, BIT(31), CLK_SET_RATE_PARENT); static const char * const lcd_ch1_parents[] = { "pll-video0", "pll-video1", "pll-video0-2x", @@ -645,13 +645,13 @@ static SUNXI_CCU_M_WITH_MUX_GATE(mipi_csi_dphy_clk, "mipi-csi-dphy", BIT(15), 0); static SUNXI_CCU_M_WITH_MUX_GATE(iep_drc0_clk, "iep-drc0", de_parents, - 0x180, 0, 3, 24, 2, BIT(31), 0); + 0x180, 0, 3, 24, 3, BIT(31), 0); static SUNXI_CCU_M_WITH_MUX_GATE(iep_drc1_clk, "iep-drc1", de_parents, - 0x184, 0, 3, 24, 2, BIT(31), 0); + 0x184, 0, 3, 24, 3, BIT(31), 0); static SUNXI_CCU_M_WITH_MUX_GATE(iep_deu0_clk, "iep-deu0", de_parents, - 0x188, 0, 3, 24, 2, BIT(31), 0); + 0x188, 0, 3, 24, 3, BIT(31), 0); static SUNXI_CCU_M_WITH_MUX_GATE(iep_deu1_clk, "iep-deu1", de_parents, - 0x18c, 0, 3, 24, 2, BIT(31), 0); + 0x18c, 0, 3, 24, 3, BIT(31), 0); static const char * const gpu_parents[] = { "pll-gpu", "pll-periph-2x", "pll-video0", "pll-video1",