All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Heiner Kallweit <hkallweit1@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>, David Miller <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Phil Reid <preid@electromag.com.au>,
	liweihang <liweihang@hisilicon.com>
Subject: Re: [PATCH net] net: phy: don't clear BMCR in genphy_soft_reset
Date: Sat, 23 Mar 2019 17:59:26 -0700	[thread overview]
Message-ID: <871d452d-6e3f-d3ad-6434-e4b552ca37d5@gmail.com> (raw)
In-Reply-To: <58079905-c107-6b41-ce04-3d88ef00d70b@gmail.com>



On 3/22/2019 12:00 PM, Heiner Kallweit wrote:
> So far we effectively clear the BMCR register. Some PHY's can deal
> with this (e.g. because they reset BMCR to a default as part of a
> soft-reset) whilst on others this causes issues because e.g. the
> autoneg bit is cleared. Marvell is an example, see also thread [0].
> So let's be a little bit more gentle and leave all bits we're not
> interested in as-is. This change is needed for PHY drivers to
> properly deal with the original patch.
> 
> [0] https://marc.info/?t=155264050700001&r=1&w=2
> 
> Fixes: 6e2d85ec0559 ("net: phy: Stop with excessive soft reset")
> Tested-by: Phil Reid <preid@electromag.com.au>
> Tested-by: liweihang <liweihang@hisilicon.com>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

Thanks for investigating and coming up with a fix for this!

> ---
>  drivers/net/phy/phy_device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 49fdd1ee7..77068c545 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -1831,7 +1831,7 @@ int genphy_soft_reset(struct phy_device *phydev)
>  {
>  	int ret;
>  
> -	ret = phy_write(phydev, MII_BMCR, BMCR_RESET);
> +	ret = phy_set_bits(phydev, MII_BMCR, BMCR_RESET);
>  	if (ret < 0)
>  		return ret;
>  
> 

-- 
Florian

  reply	other threads:[~2019-03-24  0:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22 19:00 [PATCH net] net: phy: don't clear BMCR in genphy_soft_reset Heiner Kallweit
2019-03-24  0:59 ` Florian Fainelli [this message]
2019-03-26  0:09 ` David Miller

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=871d452d-6e3f-d3ad-6434-e4b552ca37d5@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=liweihang@hisilicon.com \
    --cc=netdev@vger.kernel.org \
    --cc=preid@electromag.com.au \
    /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.