From nobody Tue Oct 7 10:34:17 2025 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DB23294A06; Thu, 10 Jul 2025 09:22:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752139324; cv=none; b=NFKWGjooQS3tR8LWkfyOszjA7w9Im6PmQLgN5e1jKL6MTVnQWu/r/rQKMkpfUlCu90iJ7U4b5E96SHKiVtGOaTnRysxlHXAStWUDb6rwVdUUzgqRmm3dYNhjnmBbDRkKTxAIvDjdPUox098Er8dABFKrvWe7n3h8+e7UBOT0Cjc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752139324; c=relaxed/simple; bh=8jv9si5Dm29nc6cOMexjPtTBEsERysb0Yr5v4WL1nzo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XPNszIwOfDHE7dgxZ4u0hSraCPYXh2Hd2LGAwGwoEOJSXGeqI7cTZsZW1L190Iq6ucHI1MsdGeuXx3LY/OfHae2ExKIdHhGdJMiYHLCTWpr2etId8m4Wz/yj36uXCJB6qJeJ8x+plVx0qhpjGm8rdsZDVMJunfc7o8IJDNO44Ig= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=ArHXbaU/; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="ArHXbaU/" Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 9AC5620E4F; Thu, 10 Jul 2025 11:21:55 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id jVRQWH_OPQYW; Thu, 10 Jul 2025 11:21:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1752139314; bh=8jv9si5Dm29nc6cOMexjPtTBEsERysb0Yr5v4WL1nzo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ArHXbaU/7hmjWGqDFqA9UhVGwP8lArLw26t0gSveZ6cI7JqQd1CQ+apBUBAhlK3E9 l1EHwYOI68jWpY2MtcJp93hAaKjp770fz9FxUz7VGLGhNwSZ7RTJQjK80DG0BET+jw dbpWJQg3oAJuG4FtiOI+GzqlnK3S9jB2hmM1DgdBnQZIsvWsRHkVlSb8F1MiKBV2Tq 5iC7G7RMMv6y2Eqhx+KxzOFGrBrgxnj+fHXMPRKbeQFcZFFmRcKk8ixSCalaw5V5o3 JJRoGz8BWaesCGy4GrFLsJYczK/Crme0E7QFHds06iifIIJs5014suMrYxc1eK9LIq Z3hGJHFT8YE1w== From: Yao Zi To: Drew Fustini , Guo Ren , Fu Wei , Michael Turquette , Stephen Boyd , Jisheng Zhang , Yangtao Li Cc: linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Yao Zi Subject: [PATCH v2 1/2] clk: thead: th1520-ap: Correctly refer the parent of osc_12m Date: Thu, 10 Jul 2025 09:21:34 +0000 Message-ID: <20250710092135.61049-2-ziyao@disroot.org> In-Reply-To: <20250710092135.61049-1-ziyao@disroot.org> References: <20250710092135.61049-1-ziyao@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The "osc_12m" fixed factor clock refers the external oscillator by setting clk_parent_data.fw_name to osc_24m, which is obviously wrong since no clock-names property is allowed for compatible thead,th1520-clk-ap. Refer the oscillator as parent by index instead. Fixes: ae81b69fd2b1 ("clk: thead: Add support for T-Head TH1520 AP_SUBSYS c= locks") Signed-off-by: Yao Zi Reviewed-by: Drew Fustini --- drivers/clk/thead/clk-th1520-ap.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/clk/thead/clk-th1520-ap.c b/drivers/clk/thead/clk-th15= 20-ap.c index ebfb1d59401d..42feb4bb6329 100644 --- a/drivers/clk/thead/clk-th1520-ap.c +++ b/drivers/clk/thead/clk-th1520-ap.c @@ -582,7 +582,14 @@ static const struct clk_parent_data peri2sys_apb_pclk_= pd[] =3D { { .hw =3D &peri2sys_apb_pclk.common.hw } }; =20 -static CLK_FIXED_FACTOR_FW_NAME(osc12m_clk, "osc_12m", "osc_24m", 2, 1, 0); +static struct clk_fixed_factor osc12m_clk =3D { + .div =3D 2, + .mult =3D 1, + .hw.init =3D CLK_HW_INIT_PARENTS_DATA("osc_12m", + osc_24m_clk, + &clk_fixed_factor_ops, + 0), +}; =20 static const char * const out_parents[] =3D { "osc_24m", "osc_12m" }; =20 --=20 2.50.0 From nobody Tue Oct 7 10:34:17 2025 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 26BB7214210; Thu, 10 Jul 2025 09:21:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752139321; cv=none; b=DJuniKjfVQAX76/Xc48iB8pkl8ulofb/o33NCYZalWKcitdpp7hlFoV0/OeK/F6Ma2Ei4HSiwSnfFqgC/4i4aOeU+Y2kodrAR7zGxV/RawQ/moHkHS029qbQP077poJIPPM4+9aGqcoJi5Rt2j28A2OfPUZNf6NklNf0SauZiVc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752139321; c=relaxed/simple; bh=YWiKfFUpvY0CTSU08o1Vxmml9LYBSTSxuK4Xhb+tbVU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Az/1VMJyEoKjaPnMFw5YYdBsWSiaFyxJwSYatu6yeZC0aHUR/54mVYpaJzVjTWbCFUFCEmlgLWtjGWcapXsBy7RruPiwJd5WVeWa3NH5KLm0lX1xRDUTiI9T8nXa6C60LW+FPEYxxebf+VamyW+evJswqo8kxZy4HCqIZYcly9g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=B1jj4Udr; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="B1jj4Udr" Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id A3EF120D9B; Thu, 10 Jul 2025 11:21:58 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id jWSHtPzeUuRu; Thu, 10 Jul 2025 11:21:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1752139318; bh=YWiKfFUpvY0CTSU08o1Vxmml9LYBSTSxuK4Xhb+tbVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=B1jj4Udrnr8mHo8CZcvxkAtHXrp4J7GrDWUcMyH722pC+J30FTb3M3XcKkRlzQ9ga KgICluIXnabEbGFRD7awmtE/6kUJpMHopz5JCkc9CsPn4JTMa+/RMv/t67KQnUp+7I JCVmXnqZMWQe2u/p9IOqblLIivktz//obRGVKbAnNkhcv4CHHF32YKTvpmVJiM1KMD vpHoKOPLFGCTumAVXOM3OUMqSaL40H96vtAo+ck57jAjWBxRArT7/C6docPRKv4nwH r5Ae8gLNXIXo5nM85BBr8+aFmIklItqZBCBfyjMVH3sThyau48MlOAHtsWSTqHdSPn DZznr9sQRHHCA== From: Yao Zi To: Drew Fustini , Guo Ren , Fu Wei , Michael Turquette , Stephen Boyd , Jisheng Zhang , Yangtao Li Cc: linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Yao Zi Subject: [PATCH v2 2/2] clk: thead: th1520-ap: Correctly refer the parent of c910-i0 Date: Thu, 10 Jul 2025 09:21:35 +0000 Message-ID: <20250710092135.61049-3-ziyao@disroot.org> In-Reply-To: <20250710092135.61049-1-ziyao@disroot.org> References: <20250710092135.61049-1-ziyao@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The correct parent of c910, c910-i0, is registered with devm_clk_hw_register_mux_parent_data_table(), which creates a clk_hw structure from scratch. But it's assigned as c910's parent by referring &c910_i0_clk.common.hw, confusing the CCF since this clk_hw structure is never registered. Refer c910-i0 by its name instead to avoid turning c910 into an orphan clock. Fixes: ae81b69fd2b1 ("clk: thead: Add support for T-Head TH1520 AP_SUBSYS c= locks") Signed-off-by: Yao Zi --- drivers/clk/thead/clk-th1520-ap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/thead/clk-th1520-ap.c b/drivers/clk/thead/clk-th15= 20-ap.c index 42feb4bb6329..41ed72b1a915 100644 --- a/drivers/clk/thead/clk-th1520-ap.c +++ b/drivers/clk/thead/clk-th1520-ap.c @@ -427,7 +427,7 @@ static struct ccu_mux c910_i0_clk =3D { }; =20 static const struct clk_parent_data c910_parents[] =3D { - { .hw =3D &c910_i0_clk.common.hw }, + { .index =3D -1, .name =3D "c910-i0" }, { .hw =3D &cpu_pll1_clk.common.hw } }; =20 --=20 2.50.0