Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: florian.fainelli@broadcom.com
Cc: netdev@vger.kernel.org, andrew@lunn.ch, nb@tipi-net.de,
	carlos.soto@broadcom.com, opendmb@gmail.com,
	bcm-kernel-feedback-list@broadcom.com, hkallweit1@gmail.com,
	linux@armlinux.org.uk, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org,
	kudzo51@gmail.com
Subject: Re: [PATCH net-next v5 3/4] net: mdio: mdio-bcm-unimac: Poll for completion at 1us granularity
Date: Tue, 24 Nov 2026 20:04:11 +0000	[thread overview]
Message-ID: <179555065159.3135.7257809284035507896@kernel.org> (raw)
In-Reply-To: <20261120194318.3952487-4-florian.fainelli@broadcom.com>

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] Concern: the commit message and the new comment in
  unimac_mdio_poll() (drivers/net/mdio/mdio-bcm-unimac.c) describe…

--

net: mdio: mdio-bcm-unimac: Poll for completion at 1us granularity

This commit drops the fixed 30us udelay() and the 2ms sleeping poll in
unimac_mdio_poll(). It now busy-polls MDIO_START_BUSY every microsecond
with read_poll_timeout_atomic(), and the timeout goes from 100ms down
to 1ms. The goal is to cut per-access latency before Clause 45 support
is added.

> diff --git a/drivers/net/mdio/mdio-bcm-unimac.c b/drivers/net/mdio/mdio-bcm-unimac.c
> index 5f79f31220f26..f8e5c1811d96b 100644
> --- a/drivers/net/mdio/mdio-bcm-unimac.c
> +++ b/drivers/net/mdio/mdio-bcm-unimac.c

[ ... ]

> @@ -79,14 +86,15 @@ static int unimac_mdio_poll(void *wait_func_data)
>  	struct unimac_mdio_priv *priv = wait_func_data;
>  	u32 val;
>  
> -	/*
> -	 * C22 transactions should take ~25 usec, will need to adjust
> -	 * if C45 support is added.
> +	/* A frame should take ~25 usec. A C22 transaction is a single frame,
> +	 * a C45 transaction is an address frame followed by a data frame and
> +	 * each of them is waited for separately.
>  	 */

[Severity: Low]
This isn't a bug, but the new comment in unimac_mdio_poll() describes C45
address and data frames that are waited for separately. At this commit
there is no C45 path yet. unimac_mdio_probe() only sets bus->read and
bus->write, and only MDIO_RD_C22/MDIO_WR_C22 are defined.

The next patch in the series, "net: mdio: mdio-bcm-unimac: Add Clause 45
support", adds unimac_mdio_addr_c45() and unimac_mdio_do_read()/do_write().
Each of these calls unimac_mdio_wait(), so the comment is accurate once
the series is applied. Would it be clearer to add this comment in that
patch, or to word it so it makes sense for this commit on its own?

The 100ms to 1ms timeout reduction for existing C22 users is stated in
the commit message. The numbers hold up: the largest divider allowed by
MDIO_CLK_DIV_MASK is 128, which gives about 1.95MHz from a 250MHz
reference clock and about 32.8us per 64 bit frame. That is well under
MDIO_POLL_TIMEOUT_US.

> -	udelay(30);
> -
> -	return read_poll_timeout(unimac_mdio_readl, val, !(val & MDIO_START_BUSY),
> -				 2000, 100000, false, priv, MDIO_CMD);
> +	return read_poll_timeout_atomic(unimac_mdio_readl, val,
> +					!(val & MDIO_START_BUSY),
> +					MDIO_POLL_DELAY_US,
> +					MDIO_POLL_TIMEOUT_US, false, priv,
> +					MDIO_CMD);
>  }

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120194318.3952487-1-florian.fainelli%40broadcom.com

  reply	other threads:[~2026-11-24 20:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 19:43 [PATCH net-next v5 0/4] net: mdio: Clause 45 support for mdio-bcm-unimac Florian Fainelli
2026-11-20 19:43 ` [PATCH net-next v5 1/4] net: phy: Map C45 probe read errors to -ENODEV during bus scan Florian Fainelli
2026-11-24 20:04   ` netdev-bot+sashiko
2026-11-20 19:43 ` [PATCH net-next v5 2/4] net: mdio: mdio-bcm-unimac: Define MDIO_OP_SHIFT Florian Fainelli
2026-11-20 19:43 ` [PATCH net-next v5 3/4] net: mdio: mdio-bcm-unimac: Poll for completion at 1us granularity Florian Fainelli
2026-11-24 20:04   ` netdev-bot+sashiko [this message]
2026-11-20 19:43 ` [PATCH net-next v5 4/4] net: mdio: mdio-bcm-unimac: Add Clause 45 support Florian Fainelli
2026-11-20 20:23   ` Nicolai Buchwitz
2026-11-20 20:29   ` Nicolai Buchwitz
2026-11-20 22:01     ` Florian Fainelli
2026-11-24 20:04   ` netdev-bot+sashiko

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=179555065159.3135.7257809284035507896@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=carlos.soto@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kudzo51@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=nb@tipi-net.de \
    --cc=netdev@vger.kernel.org \
    --cc=opendmb@gmail.com \
    --cc=pabeni@redhat.com \
    /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