From: zoan37 <agentzoan@gmail.com>
To: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>
Cc: Stephen Boyd <sboyd@kernel.org>,
Brian Masney <bmasney+clk@redhat.com>,
Jerome Brunet <jbrunet+clk@baylibre.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Chun-Jie Chen <chun-jie.chen@mediatek.com>,
Chen-Yu Tsai <wenst@chromium.org>,
Edward-JW Yang <edward-jw.yang@mediatek.com>,
Irving-CH Lin <irving-ch.lin@mediatek.com>,
kernel@collabora.com, linux-clk@vger.kernel.org,
linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] clk: mediatek: mt8189: Don't let the GPU reference mux retune MAINPLL
Date: Sun, 11 Oct 2026 15:56:12 -0400 [thread overview]
Message-ID: <20261011195612.1663714-1-agentzoan@gmail.com> (raw)
In-Reply-To: <20260904-mt8189-clocks-system-base-v6-19-5df247f56938@collabora.com>
mfg_sel_mfgpll selects the GPU clock from mfg_ref_sel or mfgpll and has
CLK_SET_RATE_PARENT, so a GPU rate request (Panfrost devfreq) goes
through __clk_mux_determine_rate(), which evaluates both parents.
mfg_ref_sel is a MUX_GATE_CLR_SET_UPD() and so also has
CLK_SET_RATE_PARENT, as does its mainpll_d6 parent: through it, any GPU
OPP can be met exactly by retuning MAINPLL to six times the requested
rate. mfg_ref_sel is parent 0, so it wins over mfgpll whenever both match.
On an MT8189 Chromebook, MAINPLL therefore followed the GPU: 2340 MHz
for the 390 MHz OPP instead of the 2184 MHz the firmware sets, and 3360
or 3570 MHz while the GPU ran at 560 or 595 MHz. Everything else derived
from MAINPLL moved with it: the peripheral and memory buses, and the
display PWM, whose backlight frequency jumped from 2 to about 3 kHz for
tens of milliseconds under GPU load. That showed as a visible brightness
flicker.
mfg_ref_sel is only the reference/bypass parent that the mux notifier
switches to while MFGPLL relocks. Don't let it propagate rate changes,
as MT8195 does for its top_mfg_core_tmp. The GPU then gets its rates
from MFGPLL, and MAINPLL stays at its firmware rate.
Assisted-by: LLM
Signed-off-by: zoan37 <agentzoan@gmail.com>
---
Found on top of v6 ("[PATCH v6 19/27] clk: mediatek: Add MT8189 topckgen
clock support"); it applies to that patch and can be squashed into it.
Testing: Lenovo IdeaPad Slim 3 Chromebook (MT8189, "quigon"),
next-20261008 plus this series and local board support, Panfrost on the
Mali-G57 with devfreq. Before: MAINPLL 2340 MHz at idle and 3360/3570 MHz
under GPU load, read from clk_summary; the display PWM's actual period
(debugfs/pwm) went from 500 us to 348/328 us with it. After: every GPU
OPP from 390 to 1100 MHz forced through devfreq min/max_freq, and
scrolling a busy page: the GPU always on mfgpll, MAINPLL fixed at
2184 MHz, the PWM steady, no flicker. No device tree change needed (the
mux selects mfgpll by itself). Built with W=1.
drivers/clk/mediatek/clk-mt8189-topckgen.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/mediatek/clk-mt8189-topckgen.c b/drivers/clk/mediatek/clk-mt8189-topckgen.c
index 6ed7661119b8..ff9fd5115c5b 100644
--- a/drivers/clk/mediatek/clk-mt8189-topckgen.c
+++ b/drivers/clk/mediatek/clk-mt8189-topckgen.c
@@ -818,9 +818,13 @@ static const struct mtk_mux top_muxes[] = {
dxcc_parents, 0x100, 0x104, 0x108,
24, 2, 31, 0x0c, 1),
/* CLK_CFG_16 */
- MUX_GATE_CLR_SET_UPD(CLK_TOP_MFG_REF_SEL, "mfg_ref_sel",
- mfg_ref_parents, 0x110, 0x114, 0x118,
- 0, 2, 7, 0x0c, 2),
+ /*
+ * Reference/bypass parent of mfg_sel_mfgpll: don't propagate rate
+ * requests, or GPU DVFS retunes MAINPLL through mainpll_d6.
+ */
+ MUX_GATE_CLR_SET_UPD_FLAGS(CLK_TOP_MFG_REF_SEL, "mfg_ref_sel",
+ mfg_ref_parents, 0x110, 0x114, 0x118,
+ 0, 2, 7, 0x0c, 2, 0),
MUX_GATE_CLR_SET_UPD(CLK_TOP_MDP0_SEL, "mdp0_sel",
mmsys_parents, 0x110, 0x114, 0x118,
8, 4, 15, 0x0c, 3),
--
2.43.0
next prev parent reply other threads:[~2026-10-11 19:57 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 15:58 [PATCH v6 00/27] MT8189: Add support for system and base clock controllers Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 01/27] dt-bindings: clock: mediatek: Make '#clock-cells' required for MT8186 Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 02/27] dt-bindings: clock: mediatek: Make '#clock-cells' required for MT8192 Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 03/27] dt-bindings: clock: mediatek: Make '#clock-cells' required for MT8195 Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 04/27] dt-bindings: clock: mediatek: reorder MT8186 compatibles Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 05/27] dt-bindings: clock: mediatek: regroup MT8188 dt-bindings into MT8186 Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 06/27] dt-bindings: clock: mediatek: regroup MT8192 " Louis-Alexis Eyraud
2026-09-04 16:11 ` sashiko-bot
2026-09-04 15:58 ` [PATCH v6 07/27] dt-bindings: clock: mediatek: regroup MT8195 " Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 08/27] dt-bindings: clock: mediatek: Add MT8189 system/base clocks and resets Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 09/27] clk: mediatek: Harmonize mtk_pll_fenc related symbol names Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 10/27] clk: mediatek: pll: Add BAR reset register offsets Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 11/27] clk: mediatek: pll: Factorise pll power on/off sequences Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 12/27] clk: mediatek: pll: Add PLL stabilization delay definition Louis-Alexis Eyraud
2026-09-04 16:11 ` sashiko-bot
2026-09-04 15:58 ` [PATCH v6 13/27] clk: mediatek: pll: Add ops for PLLs using set/clr regs Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 14/27] clk: mediatek: pllfh: Add configurable clock ops to mtk_pllfh_data Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 15/27] clk: mediatek: pllfh: Add ops for PLLs using set/clr regs Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 16/27] clk: mediatek: Move fhctl_parse_dt call into mtk_clk_register_pllfhs Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 17/27] clk: mediatek: pllfh: clear state data in mtk_clk_cleanup_pllfhs Louis-Alexis Eyraud
2026-09-04 16:18 ` sashiko-bot
2026-09-04 15:58 ` [PATCH v6 18/27] clk: mediatek: Add MT8189 apmixedsys clock support Louis-Alexis Eyraud
2026-09-04 16:17 ` sashiko-bot
2026-09-04 15:58 ` [PATCH v6 19/27] clk: mediatek: Add MT8189 topckgen " Louis-Alexis Eyraud
2026-09-04 16:20 ` sashiko-bot
2026-10-11 19:56 ` zoan37 [this message]
2026-09-04 15:58 ` [PATCH v6 20/27] clk: mediatek: Add MT8189 vlpckgen " Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 21/27] clk: mediatek: Add MT8189 vlpcfg " Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 22/27] clk: mediatek: Add MT8189 bus " Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 23/27] clk: mediatek: Add MT8189 dbgao " Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 24/27] clk: mediatek: Add MT8189 dvfsrc " Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 25/27] clk: mediatek: Add MT8189 i2c " Louis-Alexis Eyraud
2026-09-04 15:58 ` [PATCH v6 26/27] clk: mediatek: Add MT8189 scp " Louis-Alexis Eyraud
2026-09-04 16:28 ` sashiko-bot
2026-09-04 15:58 ` [PATCH v6 27/27] clk: mediatek: Add MT8189 ufs " Louis-Alexis Eyraud
2026-09-04 16:27 ` sashiko-bot
2026-09-07 10:24 ` [PATCH v6 00/27] MT8189: Add support for system and base clock controllers AngeloGioacchino Del Regno
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=20261011195612.1663714-1-agentzoan@gmail.com \
--to=agentzoan@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bmasney+clk@redhat.com \
--cc=chun-jie.chen@mediatek.com \
--cc=edward-jw.yang@mediatek.com \
--cc=irving-ch.lin@mediatek.com \
--cc=jbrunet+clk@baylibre.com \
--cc=kernel@collabora.com \
--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=louisalexis.eyraud@collabora.com \
--cc=matthias.bgg@gmail.com \
--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