Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Akari Tsuyukusa <akkun11.open@gmail.com>
To: AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney+clk@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: Akari Tsuyukusa <akkun11.open@gmail.com>,
	Chen-Yu Tsai <wenst@chromium.org>,
	Miles Chen <miles.chen@mediatek.com>,
	linux-clk@vger.kernel.org (open list:MEDIATEK CLOCK DRIVERS),
	linux-mediatek@lists.infradead.org (moderated list:MEDIATEK
	CLOCK DRIVERS),
	linux-kernel@vger.kernel.org (open list:ARM/Mediatek SoC support),
	linux-arm-kernel@lists.infradead.org (moderated
	list:ARM/Mediatek SoC support),
	devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND
	FLATTENED DEVICE TREE BINDINGS)
Subject: [PATCH linux-next 10/33] clk: mediatek: Fix MT2701 onecell IDs after common probe migration
Date: Sun, 29 Nov 2026 10:47:22 +0900	[thread overview]
Message-ID: <20261129014745.3375923-11-akkun11.open@gmail.com> (raw)
In-Reply-To: <20261129014745.3375923-1-akkun11.open@gmail.com>

Migrating the MT2701 topckgen, infracfg, pericfg and apmixedsys clock
drivers to the common probe/remove helpers stopped using CLK_*_NR for
onecell data allocation, causing out-of-bounds registrations due to
missing dummy slots for ID 0.

Add the missing dummy slots so all clock IDs stay within bounds.

Fixes: ecc3a07f599f ("clk: mediatek: mt2701: Switch to common probe/remove helpers")
Signed-off-by: Akari Tsuyukusa <akkun11.open@gmail.com>
---
 drivers/clk/mediatek/clk-mt2701.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/clk/mediatek/clk-mt2701.c b/drivers/clk/mediatek/clk-mt2701.c
index 73df452e1cfb..0db3af1a478d 100644
--- a/drivers/clk/mediatek/clk-mt2701.c
+++ b/drivers/clk/mediatek/clk-mt2701.c
@@ -638,6 +638,7 @@ static const struct mtk_gate_regs top_aud_cg_regs = {
 	GATE_MTK(_id, _name, _parent, &top_aud_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
 static const struct mtk_gate top_clks[] = {
+	GATE_DUMMY(CLK_DUMMY, "topck_dummy"),
 	GATE_TOP_AUD(CLK_TOP_AUD_48K_TIMING, "a1sys_hp_ck", "aud_mux1_div",
 		21),
 	GATE_TOP_AUD(CLK_TOP_AUD_44K_TIMING, "a2sys_hp_ck", "aud_mux2_div",
@@ -680,6 +681,7 @@ static const struct mtk_gate_regs infra_cg_regs = {
 	GATE_MTK(_id, _name, _parent, &infra_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate infra_clks[] = {
+	GATE_DUMMY(CLK_DUMMY, "infra_dummy"),
 	GATE_ICG(CLK_INFRA_DBG, "dbgclk", "axi_sel", 0),
 	GATE_ICG(CLK_INFRA_SMI, "smi_ck", "mm_sel", 1),
 	GATE_ICG(CLK_INFRA_QAXI_CM4, "cm4_ck", "axi_sel", 2),
@@ -742,6 +744,7 @@ static const struct mtk_gate_regs peri1_cg_regs = {
 	GATE_MTK(_id, _name, _parent, &peri1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate peri_clks[] = {
+	GATE_DUMMY(CLK_DUMMY, "peri_dummy"),
 	GATE_PERI0(CLK_PERI_USB0_MCU, "usb0_mcu_ck", "axi_sel", 31),
 	GATE_PERI0(CLK_PERI_ETH, "eth_ck", "clk26m", 30),
 	GATE_PERI0(CLK_PERI_SPI0, "spi0_ck", "spi0_sel", 29),
@@ -874,7 +877,13 @@ static const struct mtk_fixed_factor apmixed_fixed_divs[] = {
 	FACTOR(CLK_APMIXED_HDMI_REF, "hdmi_ref", "tvdpll", 1, 1),
 };
 
+static const struct mtk_gate apmixed_clks[] = {
+	GATE_DUMMY(CLK_DUMMY, "apmixed_dummy"),
+};
+
 static const struct mtk_clk_desc apmixedsys_desc = {
+	.clks = apmixed_clks,
+	.num_clks = ARRAY_SIZE(apmixed_clks),
 	.plls = apmixed_plls,
 	.num_plls = ARRAY_SIZE(apmixed_plls),
 	.factor_clks = apmixed_fixed_divs,
-- 
2.56.0



  parent reply	other threads:[~2026-11-29  1:48 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29  1:47 [PATCH linux-next 00/33] clk: mediatek: Fix regressions and pre-existing bugs Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 01/33] clk: mediatek: Skip common MMIO mapping for PLL-only controllers Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 02/33] clk: mediatek: Fix NULL pointer dereference in pdev remove Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 03/33] clk: mediatek: Drop unused shared_io flag Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 04/33] clk: mediatek: Pass node to of_platform_populate() in common probe Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 05/33] clk: mediatek: Fix MFG mux notifier use-after-free Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 06/33] clk: mediatek: mt2701: Keep CPU mux descriptors alive Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 07/33] clk: mediatek: mt8167: Keep muxes " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 08/33] clk: mediatek: mt8516: Keep clock " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 09/33] clk: mediatek: Reserve missing MT2701 audsys clock IDs Akari Tsuyukusa
2026-11-29  1:47 ` Akari Tsuyukusa [this message]
2026-11-29  1:47 ` [PATCH linux-next 11/33] clk: mediatek: Fix MT6779 onecell IDs after common probe migration Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 12/33] clk: mediatek: Fix MT6797 " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 13/33] clk: mediatek: Fix MT8135 " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 14/33] clk: mediatek: Fix MT8173 " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 15/33] dt-bindings: clock: mt2701: Drop unused _NR macros Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 16/33] dt-bindings: clock: mt2712: " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 17/33] dt-bindings: clock: mt6765: " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 18/33] dt-bindings: clock: mt6779: " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 19/33] dt-bindings: clock: mt6795: " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 20/33] dt-bindings: clock: mt6797: " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 21/33] dt-bindings: clock: mt7622: " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 22/33] dt-bindings: clock: mt7629: " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 23/33] dt-bindings: clock: mt7988: " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 24/33] dt-bindings: clock: mt8135: " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 25/33] dt-bindings: clock: mt8167: " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 26/33] dt-bindings: clock: mt8173: " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 27/33] dt-bindings: clock: mt8183: " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 28/33] dt-bindings: clock: mt8186: " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 29/33] dt-bindings: clock: mt8188: " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 30/33] dt-bindings: clock: mt8192: " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 31/33] dt-bindings: clock: mt8195: " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 32/33] dt-bindings: clock: mt8365: " Akari Tsuyukusa
2026-11-29  1:47 ` [PATCH linux-next 33/33] dt-bindings: clock: mt8516: " Akari Tsuyukusa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261129014745.3375923-11-akkun11.open@gmail.com \
    --to=akkun11.open@gmail.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=bmasney+clk@redhat.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet+clk@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=miles.chen@mediatek.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=wenst@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox