Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by netdev-bot+sashiko
Tue, 24 Nov 2026 20:04
Re: [PATCH net-next v5 3/4] net: mdio: mdio-bcm-unimac: Poll for completion at 1us granularity
Author: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 20:04
Date: Tue, 24 Nov 2026 20:04
72 lines
10764 bytes
10764 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads