All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxim Uvarov <muvarov@gmail.com>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: liweihang <liweihang@hisilicon.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Phil Reid <preid@electromag.com.au>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	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 23:35:20 +0300	[thread overview]
Message-ID: <CAJGZr0LyYFLrqwL59ffCFm+fhf=R6Dki79ATMsLW+K+89PfxjQ@mail.gmail.com> (raw)
In-Reply-To: <416d3171-492d-2c9f-168a-88c5d2814db2@gmail.com>

also it's suspicions that in m88e1116r_config_init() delay is present
after first soft_reset() and missed after second.

Maxim.

ср, 20 мар. 2019 г. в 21:17, Heiner Kallweit <hkallweit1@gmail.com>:
>
> 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.
>
> >>
> >> 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);
> >>
> >
>


-- 
Best regards,
Maxim Uvarov

  reply	other threads:[~2019-03-20 20:35 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 [this message]
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='CAJGZr0LyYFLrqwL59ffCFm+fhf=R6Dki79ATMsLW+K+89PfxjQ@mail.gmail.com' \
    --to=muvarov@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=hkallweit1@gmail.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 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.