Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Marek Vasut" <marex@nabladev.com>
Cc: Frank.Li@kernel.org, imx@lists.linux.dev
Subject: Re: [net-next,PATCH v2] enetc: Increase eMDIO MDC rate to 2.5 MHz
Date: Fri, 25 Sep 2026 18:06:30 +0000	[thread overview]
Message-ID: <20260925180631.58EF21F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260924180607.60932-1-marex@nabladev.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] enetc: hardcoded MDIO clock divider change overclocks MDC on faster platforms
--

commit f8edf987f57daf3802702cc91c7af187a4c08ef1
Author: Marek Vasut <marex@nabladev.com>

enetc: Increase eMDIO MDC rate to 2.5 MHz

This commit lowers the global MDIO clock divider from 258 to 66 to increase
the MDC rate to 2.5 MHz for the i.MX95 B0 platform.

> diff --git a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
> index 998aaa394e9c4..a90a04a47befd 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
> @@ -24,7 +24,7 @@
>  
>  #define ENETC_EMDIO_CFG \
>  	(MDIO_CFG_HOLD(2) | \
> -	 MDIO_CFG_CLKDIV(258) | \
> +	 MDIO_CFG_CLKDIV(66) | \
         ^^^^^^^^^^^^^^^^^^^^

[Severity: High]
Does hardcoding this lower divider overclock the MDC frequency on platforms
with a faster base clock?

The enetc_mdio.c driver is also used on other platforms like the LS1028A,
which typically run the ENETC system clock at a much faster rate (e.g.,
333 - 400 MHz).

Applying a divider of 66 on a 400 MHz clock yields an MDC frequency of
~6.06 MHz. This exceeds the IEEE 802.3 Clause 22 maximum MDC frequency of
2.5 MHz (400 ns minimum period).

Will this break MDIO communication with PHYs on these existing boards?
Should the driver dynamically calculate the divider based on the platform's
actual clock rate rather than hardcoding a value tailored only for the
i.MX95?

>  	 MDIO_CFG_NEG)
>  
>  #define MDIO_CTL_DEV_ADDR(x)	((x) & 0x1f)

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260924180607.60932-1-marex@nabladev.com?part=1

  reply	other threads:[~2026-09-25 18:06 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 18:05 [net-next,PATCH v2] enetc: Increase eMDIO MDC rate to 2.5 MHz Marek Vasut
2026-09-25 18:06 ` sashiko-bot [this message]
2026-09-25 18:43 ` netdev-bot+sashiko
2026-09-30  2:10 ` patchwork-bot+netdevbpf
2026-09-30  2:21   ` Marek Vasut
2026-09-30 20:51     ` Jakub Kicinski
2026-09-30  3:40 ` Wei Fang
2026-09-30  4:19   ` Marek Vasut
2026-09-30  6:12     ` Wei Fang
2026-09-30 13:11       ` Andrew Lunn
2026-10-01  0:04         ` Wei Fang
2026-09-30 13:27       ` Marek Vasut
2026-10-01  0:45         ` Wei Fang
2026-10-01  1:34           ` Marek Vasut
2026-10-01 10:57             ` Wei Fang
2026-10-01 13:53               ` Andrew Lunn
2026-10-01 22:43                 ` Marek Vasut
2026-10-08  3:08                   ` Wei Fang
2026-10-01 22:51             ` Jakub Kicinski
2026-10-01 23:11               ` Marek Vasut
2026-10-01 22:00         ` Marek Vasut
2026-10-08  2:34           ` Wei Fang

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=20260925180631.58EF21F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=marex@nabladev.com \
    --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