netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Phil Reid <preid@electromag.com.au>,
	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>,
	"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 07:39:16 +0100	[thread overview]
Message-ID: <84ea24f9-1f6b-749c-3072-fa8046737384@gmail.com> (raw)
In-Reply-To: <cbb4b17b-a950-7929-4b19-96edecf2574e@electromag.com.au>

On 20.03.2019 06:16, Phil Reid wrote:
> 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);

Hmm, that would mean in your case some set bit needs to be preserved.
Usually that's not needed. Could you please check which value is read
from MII_BMCR?

>         if (ret < 0)
>                 return ret;
> 
> 
> 
> 
> 
> 
> 
> 


  reply	other threads:[~2019-03-20  6:39 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
2019-03-20  6:39                       ` Heiner Kallweit [this message]
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=84ea24f9-1f6b-749c-3072-fa8046737384@gmail.com \
    --to=hkallweit1@gmail.com \
    --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=liweihang@hisilicon.com \
    --cc=nbd@nbd.name \
    --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 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).