All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Reid <preid@electromag.com.au>
To: Florian Fainelli <f.fainelli@gmail.com>,
	liweihang <liweihang@hisilicon.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: Andrew Lunn <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"dongsheng.wang@hxt-semitech.com"
	<dongsheng.wang@hxt-semitech.com>,
	"cphealy@gmail.com" <cphealy@gmail.com>,
	"clemens.gruber@pqgruber.com" <clemens.gruber@pqgruber.com>,
	"hkallweit1@gmail.com" <hkallweit1@gmail.com>,
	"nbd@nbd.name" <nbd@nbd.name>,
	"harini.katakam@xilinx.com" <harini.katakam@xilinx.com>
Subject: Re: regression from: net: phy: marvell: Avoid unnecessary soft reset
Date: Wed, 20 Mar 2019 13:16:56 +0800	[thread overview]
Message-ID: <cbb4b17b-a950-7929-4b19-96edecf2574e@electromag.com.au> (raw)
In-Reply-To: <5e258872-34cf-f82f-bcbc-539a74ba8561@gmail.com>

On 20/03/2019 11:37 am, Florian Fainelli wrote:
> 
> 
> On 3/19/2019 7:34 PM, liweihang wrote:
>> Hi all,
>>
>> I've met a similar issue and sent an email to discuss about it before:
>> Question about setting speed and duplex failed after auto-negotiation disabled on marvell phy
>>
>> d6ab93364734 net: phy: marvell: Avoid unnecessary soft reset
>> I reverted this patch and the auto-negotiation works ok.
>>
>> Florian, could you please read my previous email and give me some advice?
> 
> If you can copy the patch author on that email the next time that will
> help expedite things.
> 
> So the problem seems to come from the fact that unless the BCMR_RESET
> bit is written, then m88e1121_config_aneg_rgmii_delays() has no effect,
> does that sound like what you are observing?
> 
> Does the following work for you (Phil and yourself)?
> 
> diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
> index 3ccba37bd6dd..6a1ea4c2042a 100644
> --- a/drivers/net/phy/marvell.c
> +++ b/drivers/net/phy/marvell.c
> @@ -448,6 +448,10 @@ static int m88e1121_config_aneg(struct phy_device
> *phydev)
>                  err = m88e1121_config_aneg_rgmii_delays(phydev);
>                  if (err < 0)
>                          return err;
> +
> +               err = genphy_soft_reset(phydev);
> +               if (err < 0)
> +                       return err;
>          }
> 
>          err = marvell_set_polarity(phydev, phydev->mdix_ctrl);
> 


G'day Florian,

Nope that didn't work for me.
But based on that patch and liweihang email I found the following works for me:

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 46c8672..de71aef 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1827,7 +1827,13 @@ int genphy_soft_reset(struct phy_device *phydev)
  {
         int ret;

-       ret = phy_write(phydev, MII_BMCR, BMCR_RESET);
+       phydev_err(phydev, "genphy_soft_reset");
+
+       ret = phy_read(phydev, MII_BMCR);
+       if (ret < 0)
+               return ret;
+
+       ret = phy_write(phydev, MII_BMCR, ret | BMCR_RESET);
         if (ret < 0)
                 return ret;








-- 
Regards
Phil

  reply	other threads:[~2019-03-20  5:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25 18:28 [PATCH net-next 0/2] net: phy: Eliminate unnecessary soft Florian Fainelli
2018-09-25 18:28 ` [PATCH net-next 1/2] net: phy: Stop with excessive soft reset Florian Fainelli
2018-09-25 18:28 ` [PATCH net-next 2/2] net: phy: marvell: Avoid unnecessary " Florian Fainelli
2019-03-15  8:52   ` regression from: " Phil Reid
2019-03-15 21:58     ` Florian Fainelli
2019-03-18  2:11       ` Phil Reid
2019-03-18 17:09         ` Florian Fainelli
2019-03-18 17:15           ` Andrew Lunn
2019-03-18 17:18             ` Chris Healy
2019-03-18 17:53               ` Andrew Lunn
2019-03-19  1:32           ` Phil Reid
2019-03-19 16:53             ` Florian Fainelli
2019-03-20  1:33               ` Phil Reid
2019-03-20  2:34                 ` liweihang
2019-03-20  3:37                   ` Florian Fainelli
2019-03-20  5:16                     ` Phil Reid [this message]
2019-03-20  6:39                       ` Heiner Kallweit
2019-03-20  7:08                         ` Phil Reid
2019-03-20 12:22                     ` liweihang
2019-03-20 18:15                       ` Heiner Kallweit
2019-03-20 20:35                         ` Maxim Uvarov
2019-03-21  6:16                         ` liweihang
2019-03-21  8:07                           ` Phil Reid
2018-09-26  3:27 ` [PATCH net-next 0/2] net: phy: Eliminate unnecessary soft 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=cbb4b17b-a950-7929-4b19-96edecf2574e@electromag.com.au \
    --to=preid@electromag.com.au \
    --cc=andrew@lunn.ch \
    --cc=clemens.gruber@pqgruber.com \
    --cc=cphealy@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dongsheng.wang@hxt-semitech.com \
    --cc=f.fainelli@gmail.com \
    --cc=harini.katakam@xilinx.com \
    --cc=hkallweit1@gmail.com \
    --cc=liweihang@hisilicon.com \
    --cc=nbd@nbd.name \
    --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 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.