Linux clock framework development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Arnaud Ferraris" <arnaud.ferraris@collabora.com>
Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 2/2] clk: mediatek: mt8196: Add clocks needed for Ethernet
Date: Fri, 04 Dec 2026 14:52:00 +0000	[thread overview]
Message-ID: <sashiko-outbox-250023@kernel.org> (raw)
In-Reply-To: <20261203-mt8196-net-clocks-v1-2-c23567b55dff@collabora.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] clk: mediatek: mt8196 gmac_125m uses 1/5 divider net1pll_d5
  instead of 1/10
- [Low] clk: mediatek: duplicate SGMII parent arrays in
  clk-mt8196-topckgen.c
--

commit a6333bb8a54b98bb2785eda186ab22038a6646f2
Author: Arnaud Ferraris <arnaud.ferraris@collabora.com>

clk: mediatek: mt8196: Add clocks needed for Ethernet

This commit adds the fixed-factor dividers and topckgen/vlpckgen muxes
needed for the MT8196 Ethernet MAC and HSGMII PHYs.

> diff --git a/drivers/clk/mediatek/clk-mt8196-topckgen.c b/drivers/clk/mediatek/clk-mt8196-topckgen.c
> index 6ace11ef6b694..90d03bdd426b7 100644
> --- a/drivers/clk/mediatek/clk-mt8196-topckgen.c
> +++ b/drivers/clk/mediatek/clk-mt8196-topckgen.c

[ ... ]

> @@ -612,6 +630,48 @@ static const char * const sflash_parents[] = {
>  	"univpll_d6_d8"
>  };
>  
> +static const char * const sgmii0_ref_325m_parents[] = {
> +	"clk26m",
> +	"sgmiipll"
> +};
> +
> +static const char * const sgmii0_reg_parents[] = {
> +	"clk26m",
> +	"mainpll_d7_d4"
> +};
> +
> +static const char * const sgmii1_ref_325m_parents[] = {
> +	"clk26m",
> +	"sgmiipll"
> +};
> +
> +static const char * const sgmii1_reg_parents[] = {
> +	"clk26m",
> +	"mainpll_d7_d4"
> +};

[Severity: Low]
This isn't a bug, but sgmii1_ref_325m_parents and sgmii1_reg_parents
duplicate the sgmii0 arrays verbatim.  Could these share
sgmii_ref_325m_parents and sgmii_reg_parents to match spu_parents and
tl_parents in this driver?

> +
> +static const char * const gmac_312p5m_parents[] = {
> +	"clk26m",
> +	"net1pll_d4"
> +};
> +
> +static const char * const gmac_125m_parents[] = {
> +	"clk26m",
> +	"net1pll_d5"
> +};
> +
> +static const char * const gmac_rmii_parents[] = {
> +	"clk26m",
> +	"net1pll_d5_d5"
> +};

[Severity: Medium]
Should gmac_125m use a 1/10 divider (such as net1pll_d5_d2) instead of
net1pll_d5?

gmac_312p5m uses net1pll_d4 (1/4) and gmac_rmii uses net1pll_d5_d5
(1/25), which both require net1pll to run at 1250 MHz.  At 1250 MHz,
net1pll_d5 (1/5) produces 250 MHz rather than 125 MHz.

Because CLK_TOP_GMAC_125M uses mtk_clk_mux_determine_rate(), which calls
clk_mux_determine_rate_flags() with flags = 0, only parents at or below
the requested rate are considered.  A 125 MHz clk_set_rate() call on
gmac_125m will therefore reject net1pll_d5 and fall back to clk26m.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203-mt8196-net-clocks-v1-0-c23567b55dff@collabora.com?part=2

      reply	other threads:[~2026-12-04 14:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 14:49 [PATCH 0/2] clk: mediatek: mt8196: Add clocks needed for Ethernet Arnaud Ferraris
2026-12-03 14:49 ` [PATCH 1/2] dt-bindings: clock: Add IDs for MediaTek MT8196 Ethernet clocks Arnaud Ferraris
2026-12-03 14:49 ` [PATCH 2/2] clk: mediatek: mt8196: Add clocks needed for Ethernet Arnaud Ferraris
2026-12-04 14:52   ` sashiko-bot [this message]

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=sashiko-outbox-250023@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=arnaud.ferraris@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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