Re: [PATCH net v2 04/12] net: au1000: report MDIO transaction timeouts
From: netdev-bot+sashiko
Date: Mon Nov 16 2026 - 08:50:52 EST
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The patch adds a second timeout exit to au1000_mdio_write()
(drivers/net/ethernet/amd/au1000_eth.c), and both exits log the same…
--
net: au1000: report MDIO transaction timeouts
This commit makes au1000_mdio_write() return -ETIMEDOUT instead of
reporting success when the MII controller stays busy. It also adds a
readl_poll_timeout() check after the write so that a failed final
transaction is reported to phylib. The read path now returns -ETIMEDOUT
instead of -1.
> diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c
> index 7063f9e5bc7c0..6b2e216a83618 100644
> --- a/drivers/net/ethernet/amd/au1000_eth.c
> +++ b/drivers/net/ethernet/amd/au1000_eth.c
[ ... ]
> @@ -292,26 +293,27 @@ static int au1000_mdio_read(struct net_device *dev, int phy_addr, int reg)
[ ... ]
> while (readl(mii_control_reg) & MAC_MII_BUSY) {
> mdelay(1);
> if (--timedout == 0) {
> netdev_err(dev, "mdio_write busy timeout!!\n");
> - return;
> + return -ETIMEDOUT;
> }
> }
>
> @@ -320,6 +322,13 @@ static void au1000_mdio_write(struct net_device *dev, int phy_addr,
>
> writel(value, mii_data_reg);
> writel(mii_control, mii_control_reg);
> +
> + ret = readl_poll_timeout(mii_control_reg, mii_control,
> + !(mii_control & MAC_MII_BUSY), 20, 20000);
> + if (ret)
> + netdev_err(dev, "mdio_write busy timeout!!\n");
[Severity: Low]
This isn't a bug, but could this message use different wording from the
one in the busy wait loop above?
Both timeout paths in au1000_mdio_write() now print "mdio_write busy
timeout!!". The first one fires before anything is written to the
registers. The new one fires after writel() has already started the
transaction, so the PHY register may or may not have been changed. From
dmesg there is no way to tell which of the two happened.
au1000_mdio_read() already uses two separate messages ("read_MII busy
timeout!!" and "mdio_read busy timeout!!"). Something like "mdio_write
completion timeout" here would separate the two write cases the same way.
> +
> + return ret;
> }
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112045301.3669532-1-f.fainelli%40gmail.com