netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: LABBE Corentin <clabbe@baylibre.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	davem@davemloft.net, fugang.duan@nxp.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] net: ethernet: fec: Add missing SPEED_
Date: Sat, 20 Oct 2018 22:32:41 +0200	[thread overview]
Message-ID: <20181020203241.GC6615@lunn.ch> (raw)
In-Reply-To: <20181018195909.GA11317@Red>

On Thu, Oct 18, 2018 at 09:59:09PM +0200, LABBE Corentin wrote:
> On Thu, Oct 18, 2018 at 12:38:32PM -0700, Florian Fainelli wrote:
> > On 10/18/2018 12:16 PM, LABBE Corentin wrote:
> > > On Thu, Oct 18, 2018 at 11:55:49AM -0700, Florian Fainelli wrote:
> > >> On 10/18/2018 11:47 AM, LABBE Corentin wrote:
> > >>> On Thu, Oct 18, 2018 at 11:39:24AM -0700, Florian Fainelli wrote:
> > >>>> On 10/18/2018 08:05 AM, Corentin Labbe wrote:
> > >>>>> Since commit 58056c1e1b0e ("net: ethernet: Use phy_set_max_speed() to limit advertised speed"), the fec driver is unable to get any link.
> > >>>>> This is due to missing SPEED_.
> > >>>>
> > >>>> But SPEED_1000 is defined in include/uapi/linux/ethtool.h as 1000, so
> > >>>> surely this would amount to the same code paths being taken or am I
> > >>>> missing something here?
> > >>>
> > >>> The bisect session pointed your patch, reverting it fix the issue.
> > >>> BUT since the fix seemed trivial I sent the patch without more test then compile it.
> > >>> Sorry, I have just found some minutes ago that it didnt fix the issue.
> > >>>
> > >>> But your patch is still the cause for sure.
> > >>>
> > >>
> > >> What you are writing is really lowering the confidence level, first
> > >> Andrew is the author of that patch, and second "just compiling" and
> > >> pretending this fixes a problem when it does not is not quite what I
> > >> would expect.
> > >>
> > >> I don't have a problem helping you find the solution or the right fix
> > >> though, even if it is not my patch, but please get the author and actual
> > >> problem right so we can move forward in confidence, thanks!
> > > 
> > > Sorry again, I wanted to acknoledge my error but I did it too fast and late.
> > > And sorry to have confound you with Andrew.
> > 
> > No worries, here to help, let us know what your bisection points to. THanks
> 
> I have added printing of phydev->supported
> My working kernel (on top of 58056c1e1b0e + revert patch) got:
> [    5.550838] fec_enet_mii_probe 2ff (gbit features)
> [    5.555848] fec_enet_mii_probe 2ef (without 1000baseT_Half)
> [    5.561620] fec_enet_mii_probe 22ef final (after pause)
> [    5.566914] Micrel KSZ9021 Gigabit PHY 2188000.ethernet-1:06: attached PHY driver [Micrel KSZ9021 Gigabit PHY] (mii_bus:phy_addr=2188000.ethernet-1:06, irq=POLL)

I just looked at the datasheet for the KSZ9021. It supports Pause and
ASym Pause. So i would expect these bits to be set. However, the FEC
MAC is unable to support Asym pause, it only supports Pause. So it is
the MAC drivers responsibility to clear Asym Pause.

        /* mask with MAC supported features */
	if (fep->quirks & FEC_QUIRK_HAS_GBIT) {
                phy_set_max_speed(phy_dev, 1000);
                phy_remove_link_mode(phy_dev,
                                     ETHTOOL_LINK_MODE_1000baseT_Half_BIT);
#if !defined(CONFIG_M5272)
	phy_support_sym_pause(phy_dev);
#endif
        }
        else
                phy_set_max_speed(phy_dev, 100);

I think we just need to take this #if !defined out, so always
indicating that sym_pause is supported. And we want
phy_support_sym_pause() to clear the asym_pause bit, if set.

	Andrew

  parent reply	other threads:[~2018-10-20 20:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-18 15:05 [PATCH] net: ethernet: fec: Add missing SPEED_ Corentin Labbe
2018-10-18 18:39 ` Florian Fainelli
2018-10-18 18:47   ` LABBE Corentin
2018-10-18 18:55     ` Florian Fainelli
2018-10-18 19:16       ` LABBE Corentin
2018-10-18 19:38         ` Florian Fainelli
2018-10-18 19:59           ` LABBE Corentin
2018-10-18 20:10             ` Florian Fainelli
2018-10-18 20:41               ` Heiner Kallweit
2018-10-19  7:07                 ` Andy Duan
2018-10-20 15:39                 ` Andrew Lunn
2018-10-20 15:51                   ` Heiner Kallweit
2018-10-20 18:59                     ` Andrew Lunn
2018-10-20 19:26                       ` Heiner Kallweit
2018-10-20 20:12                         ` Andrew Lunn
2018-10-20 20:32             ` Andrew Lunn [this message]
2018-10-19 14:42           ` LABBE Corentin

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=20181020203241.GC6615@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=clabbe@baylibre.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=fugang.duan@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 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).