All of lore.kernel.org
 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] enetc: Set eMDIO MDC rate to 2.5 MHz only on i.MX95
Date: Sat, 03 Oct 2026 01:34:05 +0000	[thread overview]
Message-ID: <20261003013406.536AF1F00898@smtp.kernel.org> (raw)
In-Reply-To: <20261001223947.60189-1-marex@nabladev.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] net: enetc: uninitialized mdc_div breaks MDIO for non-PCI users
--

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

enetc: Set eMDIO MDC rate to 2.5 MHz only on i.MX95

The current eMDIO MDC rate is 2.5 MHz on i.MX95 B0. It was pointed
out by NXP, that the MDC rate is divided down from clock of different
frequency and using different division ratio on different SoCs. Configure
the i.MX95 eMDIO MDC rate to 2.5 MHz to match the 802.3 specification
and reinstate previous divider ratio for all other SoCs.

> diff --git a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
> index a90a04a47befd..7ed9b9120f447 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc_mdio.c
[ ... ]
> @@ -63,7 +63,7 @@ int enetc_mdio_write_c22(struct mii_bus *bus, int phy_id, int regnum,
>  	u16 dev_addr;
>  	int ret;
>  
> -	mdio_cfg = ENETC_EMDIO_CFG;
> +	mdio_cfg = ENETC_EMDIO_CFG(mdio_priv->mdc_div);

[Severity: High]
Does this code break MDIO communication for non-PCI users?

The mdio_priv struct is allocated and zero-initialized by drivers such as
the enetc PF driver (drivers/net/ethernet/freescale/enetc/enetc_pf_common.c
in enetc_mdio_probe() and enetc_imdio_create()), the DSA NETC driver
(drivers/net/dsa/netc/netc_main.c in netc_port_create_emdio_bus()), and the
Ocelot driver (drivers/net/dsa/ocelot/felix_vsc9959.c in
vsc9959_mdio_bus_alloc()) via devm_mdiobus_alloc_size() or
mdiobus_alloc_size().

Since this patch only initializes mdc_div in enetc_pci_mdio_probe(), mdc_div
remains 0 for these other drivers.

When enetc_mdio_write_c22() and other MDIO accessors use
ENETC_EMDIO_CFG(mdio_priv->mdc_div), the MDC clock divisor will be set to 0
instead of a valid value (like 66). This results in a clock rate that
violates the IEEE 802.3 2.5 MHz limit, breaking PHY probing and leaving
network interfaces unusable.

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

  parent reply	other threads:[~2026-10-03  1:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 22:38 [net-next,PATCH] enetc: Set eMDIO MDC rate to 2.5 MHz only on i.MX95 Marek Vasut
2026-10-01 22:43 ` netdev-bot+sinfo
2026-10-03  1:34 ` sashiko-bot [this message]
2026-10-03  3:57   ` Marek Vasut
2026-10-08  3:27     ` Wei Fang
2026-10-05 15:30 ` netdev-bot+sashiko
2026-10-08  0:22   ` Jakub Kicinski
2026-10-08  3:24 ` 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=20261003013406.536AF1F00898@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 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.