All of lore.kernel.org
 help / color / mirror / Atom feed
From: liweihang <liweihang@hisilicon.com>
To: Heiner Kallweit <hkallweit1@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Phil Reid <preid@electromag.com.au>,
	"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: Thu, 21 Mar 2019 06:16:57 +0000	[thread overview]
Message-ID: <B82435381E3B2943AA4D2826ADEF0B3A0150B240@DGGEMM506-MBX.china.huawei.com> (raw)
In-Reply-To: <416d3171-492d-2c9f-168a-88c5d2814db2@gmail.com>



> -----Original Message-----
> From: Heiner Kallweit [mailto:hkallweit1@gmail.com]
> Sent: Thursday, March 21, 2019 2:15 AM
> To: liweihang <liweihang@hisilicon.com>; Florian Fainelli
> <f.fainelli@gmail.com>; Phil Reid <preid@electromag.com.au>;
> netdev@vger.kernel.org
> Cc: Andrew Lunn <andrew@lunn.ch>; David S. Miller
> <davem@davemloft.net>; dongsheng.wang@hxt-semitech.com;
> cphealy@gmail.com; clemens.gruber@pqgruber.com; nbd@nbd.name;
> harini.katakam@xilinx.com
> Subject: Re: regression from: net: phy: marvell: Avoid unnecessary soft reset
> 
> On 20.03.2019 13:22, liweihang wrote:
> >
> >
> >> -----Original Message-----
> >> From: Florian Fainelli [mailto:f.fainelli@gmail.com]
> >> Sent: Wednesday, March 20, 2019 11:37 AM
> >> To: liweihang <liweihang@hisilicon.com>; Phil Reid
> >> <preid@electromag.com.au>; netdev@vger.kernel.org
> >> Cc: Andrew Lunn <andrew@lunn.ch>; David S. Miller
> >> <davem@davemloft.net>; dongsheng.wang@hxt-semitech.com;
> >> cphealy@gmail.com; clemens.gruber@pqgruber.com;
> hkallweit1@gmail.com;
> >> nbd@nbd.name; harini.katakam@xilinx.com
> >> Subject: Re: regression from: net: phy: marvell: Avoid unnecessary
> >> soft reset
> >>
> >>
> >>
> >> 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)?
> >
> > Thank you, Florian. But that didn't work for me either. I think the
> > key question is as what Heiner said, some bits need to be preserved.
> >
> > The MII_BMCR contained information of speed and duplex mode, but
> when
> > we call genphy_soft_reset(), these bits will be cleared.
> >
> I think instead of
> 
> ret = phy_write(phydev, MII_BMCR, BMCR_RESET);
> 
> we should use
> 
> ret = phy_set_bits(phydev, MII_BMCR, BMCR_RESET);
> 
> This is still in line with Clause 22 but covers more PHY's. A lot of PHY's won't
> be affected because they reset all BMCR bits to a default anyway.
> Could you please test this? If it's ok for you I'd submit a patch.
> 

Thank you, Heiner. It works ok on my device with following change as you
suggested.

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 509d940..7241646 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1874,7 +1874,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;


  parent reply	other threads:[~2019-03-21  6: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
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 [this message]
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=B82435381E3B2943AA4D2826ADEF0B3A0150B240@DGGEMM506-MBX.china.huawei.com \
    --to=liweihang@hisilicon.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=hkallweit1@gmail.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 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.