netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Jiawen Wu <jiawenwu@trustnetic.com>,
	linux@armlinux.org.uk,  kabel@kernel.org, andrew@lunn.ch,
	hkallweit1@gmail.com, davem@davemloft.net,  edumazet@google.com,
	kuba@kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net v2] net: phy: marvell10g: fix 88x3310 power up
Date: Thu, 20 Jul 2023 13:34:25 +0200	[thread overview]
Message-ID: <5781d16d42ae02742af5ebaaf29875a0779b2d92.camel@redhat.com> (raw)
In-Reply-To: <20230719092233.137844-1-jiawenwu@trustnetic.com>

On Wed, 2023-07-19 at 17:22 +0800, Jiawen Wu wrote:
> Clear MV_V2_PORT_CTRL_PWRDOWN bit to set power up for 88x3310 PHY,
> it sometimes does not take effect immediately. And a read of this
> register causes the bit not to clear. This will cause mv3310_reset()
> to time out, which will fail the config initialization. So add a delay
> before the next access.
> 
> Fixes: c9cc1c815d36 ("net: phy: marvell10g: place in powersave mode at probe")
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
> ---
> v1 -> v2:
> - change poll-bit-clear to time delay
> ---
>  drivers/net/phy/marvell10g.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
> index 55d9d7acc32e..d4bb90d76881 100644
> --- a/drivers/net/phy/marvell10g.c
> +++ b/drivers/net/phy/marvell10g.c
> @@ -328,6 +328,13 @@ static int mv3310_power_up(struct phy_device *phydev)
>  	ret = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL,
>  				 MV_V2_PORT_CTRL_PWRDOWN);
>  
> +	/* Sometimes, the power down bit doesn't clear immediately, and
> +	 * a read of this register causes the bit not to clear. Delay
> +	 * 100us to allow the PHY to come out of power down mode before
> +	 * the next access.
> +	 */
> +	udelay(100);

Out of sheer ignorance, would an usleep_range(...) be more appropriate
here?

Thanks!

Paolo


  parent reply	other threads:[~2023-07-20 11:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-19  9:22 [PATCH net v2] net: phy: marvell10g: fix 88x3310 power up Jiawen Wu
2023-07-19  9:13 ` Russell King (Oracle)
2023-07-20 11:34 ` Paolo Abeni [this message]
2023-07-23 10:50 ` patchwork-bot+netdevbpf

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=5781d16d42ae02742af5ebaaf29875a0779b2d92.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=jiawenwu@trustnetic.com \
    --cc=kabel@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).