All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Justin Chen <justin.chen@broadcom.com>,
	netdev@vger.kernel.org, Doug Berger <opendmb@gmail.com>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Broadcom internal kernel review list 
	<bcm-kernel-feedback-list@broadcom.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: mdio: mdio-bcm-unimac: Delay before first poll
Date: Wed, 13 Dec 2023 15:01:09 +0000	[thread overview]
Message-ID: <ZXnHNTreKY/F2Aqm@shell.armlinux.org.uk> (raw)
In-Reply-To: <c3cc7a9d-d464-48e7-beb7-b90b1abbcfc7@lunn.ch>

On Wed, Dec 13, 2023 at 11:57:52AM +0100, Andrew Lunn wrote:
> On Tue, Dec 12, 2023 at 04:02:49PM -0800, Justin Chen wrote:
> > With a clock interval of 400 nsec and a 64 bit transactions (32 bit
> > preamble & 16 bit control & 16 bit data), it is reasonable to assume
> > the mdio transaction will take 25.6 usec. Add a 30 usec delay before
> > the first poll to reduce the chance of a 1000-2000 usec sleep.
> 
> #define  MDIO_C45               0
> 
> suggests the hardware can do C45? The timing works out different then.
> Maybe add a comment by the udelay() that is assumes C22, to give a
> clue to somebody who is adding C45 support the delay needs to be
> re-evaluated.

Note, however, that the driver only supports C22 operations (it only
populates the read|write functions, not the c45 variants).

However, it doesn't explicitly set the MDIO_C22 bit in the configuration
register, so what ends up being spat out on the bus would be dependent
on the boot loader configuration.

However, I'm wondering why unimac_mdio_poll() isn't written as
(based on current code):

	return read_poll_timeout(unimac_mdio_readl(priv, MDIO_CMD), val,
				 !(val & MDIO_START_BUSY), 2000,
				 2000000);

rather than open-coding the io polling.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2023-12-13 15:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13  0:02 [PATCH] net: mdio: mdio-bcm-unimac: Delay before first poll Justin Chen
2023-12-13  0:08 ` Florian Fainelli
2023-12-13 10:57 ` Andrew Lunn
2023-12-13 15:01   ` Russell King (Oracle) [this message]
2023-12-13 16:20     ` Florian Fainelli
2023-12-13 22:00     ` Andrew Lunn

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=ZXnHNTreKY/F2Aqm@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=hkallweit1@gmail.com \
    --cc=justin.chen@broadcom.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 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.