All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Louis-Alexis Eyraud" <louisalexis.eyraud@collabora.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH net-next v3 5/9] net: stmmac: mediatek: add RX/TX delay stage divider in platform data
Date: Sat, 17 Oct 2026 10:32:16 +0000	[thread overview]
Message-ID: <sashiko-outbox-175459@kernel.org> (raw)
In-Reply-To: <20261016-dwmac-mediatek-mt8189-v3-5-25daf2bbcf35@collabora.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] net: stmmac: mediatek: copy-paste error assigns RMII macro to RGMII TX delay divider
--

commit c43e3615c53c38caf38fb0fc788d29a2ffa994ad
Author: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>

    net: stmmac: mediatek: add RX/TX delay stage divider in platform data

This commit adds RX and TX delay stage divider values to the variant
platform data for MediaTek SoCs. This prepares the driver for newer SoCs
like MT8189 which have different internal delay stage steps.

> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> index 596411d4a5b2b..cb5bda53edb94 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c

[ ... ]

> @@ -258,6 +270,10 @@ static const struct mediatek_dwmac_variant mt2712_gmac_variant = {
>  	.num_clks = ARRAY_SIZE(mt2712_dwmac_clk_l),
>  	.rx_delay_max = MT2712_RGMII_DLY_RXC_MAX,
>  	.tx_delay_max = MT2712_RGMII_DLY_TXC_MAX,
> +	.rx_rmii_delay_stage_div = MT2712_RMII_DLY_RXC_STAGE_DIV,
> +	.tx_rmii_delay_stage_div = MT2712_RMII_DLY_TXC_STAGE_DIV,
> +	.rx_rgmii_delay_stage_div = MT2712_RGMII_DLY_RXC_STAGE_DIV,
> +	.tx_rgmii_delay_stage_div = MT2712_RMII_DLY_TXC_STAGE_DIV,
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

[Severity: High]
Does this initialization assign the wrong macro for the RGMII TX delay divider?

It looks like mt2712_gmac_variant.tx_rgmii_delay_stage_div is being initialized
with the MT2712_RMII_DLY_TXC_STAGE_DIV macro instead of the RGMII variant due
to a possible copy-paste error.

Before this patch, mt2712_set_delay() correctly used the RGMII constant for
the tx_delay_stage_div. Because of this error, when configuring the TX delay
for an RGMII interface on the MT2712 platform, the driver will now divide the
delay by the RMII constant instead.

This will result in an incorrect, much larger delay stage value being
programmed into the PERI_ETH_DLY register via the ETH_DLY_GTXC_STAGES field,
which could break RGMII transmission timing.

>  	.dma_bit_mask = 33,
>  };

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261016-dwmac-mediatek-mt8189-v3-0-25daf2bbcf35@collabora.com?part=5

  parent reply	other threads:[~2026-10-17 10:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 10:31 [PATCH net-next v3 0/9] net/stmmac: Add Mediatek MT8189 support Louis-Alexis Eyraud
2026-10-16 10:31 ` [PATCH net-next v3 1/9] dt-bindings: net: mediatek-dwmac: fix unit in rx/tx delay property description Louis-Alexis Eyraud
2026-10-16 15:33   ` Andrew Lunn
2026-10-16 10:31 ` [PATCH net-next v3 2/9] dt-bindings: net: mediatek-dwmac: add support for MT8189 SoC Louis-Alexis Eyraud
2026-10-16 15:40   ` Andrew Lunn
2026-10-16 10:31 ` [PATCH net-next v3 3/9] net: stmmac: mediatek: simplify TX/RX delay handling in mt8195_set_delay Louis-Alexis Eyraud
2026-10-16 10:31 ` [PATCH net-next v3 4/9] net: stmmac: mediatek: simplify TX/RX delay handling in mt2712_set_delay Louis-Alexis Eyraud
2026-10-17 10:32   ` sashiko-bot
2026-10-16 10:31 ` [PATCH net-next v3 5/9] net: stmmac: mediatek: add RX/TX delay stage divider in platform data Louis-Alexis Eyraud
2026-10-16 11:37   ` Maxime Chevallier
2026-10-17 10:32   ` sashiko-bot [this message]
2026-10-16 10:31 ` [PATCH net-next v3 6/9] net: stmmac: mediatek: add PERI_ETH_CTRLx register offset " Louis-Alexis Eyraud
2026-10-16 10:31 ` [PATCH net-next v3 7/9] net: stmmac: mediatek: use TX clock phase shift in RGMII mode with 1Gbps speed Louis-Alexis Eyraud
2026-10-16 11:41   ` Maxime Chevallier
2026-10-16 15:48     ` Andrew Lunn
2026-10-17 10:32   ` sashiko-bot
2026-10-16 10:31 ` [PATCH net-next v3 8/9] net: stmmac: mediatek: add support for TX clock output enable feature Louis-Alexis Eyraud
2026-10-16 10:31 ` [PATCH net-next v3 9/9] net: stmmac: mediatek: add support for MT8189 SoC Louis-Alexis Eyraud

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-175459@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=louisalexis.eyraud@collabora.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.