netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Martin Rowe <martin.p.rowe@gmail.com>,
	netdev@vger.kernel.org, davem@davemloft.net,
	vivien.didelot@gmail.com
Subject: Re: bug: net: dsa: mv88e6xxx: unable to tx or rx with Clearfog GT 8K (with git bisect)
Date: Fri, 17 Jul 2020 21:42:37 +0200	[thread overview]
Message-ID: <20200717194237.GE1339445@lunn.ch> (raw)
In-Reply-To: <20200717185119.GL1551@shell.armlinux.org.uk>

On Fri, Jul 17, 2020 at 07:51:19PM +0100, Russell King - ARM Linux admin wrote:
> On Fri, Jul 17, 2020 at 12:50:07PM +0000, Martin Rowe wrote:
> > On Fri, 17 Jul 2020 at 09:22, Russell King - ARM Linux admin
> > <linux@armlinux.org.uk> wrote:
> > > The key file is /sys/kernel/debug/mv88e6xxx.0/regs - please send the
> > > contents of that file.
> > 
> > $ cat regs.broken
> >     GLOBAL GLOBAL2 SERDES     0    1    2    3    4    5
> >  0:  c800       0    ffff  9e07 9e4f 100f 100f 9e4f 170b
> >  1:     0    803e    ffff     3    3    3    3    3 201f
>                                                       ^^^^
> This is where the problem is.
> 
> >  1:     0    803e    ffff     3    3    3    3    3 203f
>                                                       ^^^^
> 
> In the broken case, the link is forced down, in the working case, the
> link is forced up.
> 
> What seems to be happening is:
> 
> dsa_port_link_register_of() gets called, and we do this:
> 
>                 phy_np = of_parse_phandle(dp->dn, "phy-handle", 0);
>                 if (of_phy_is_fixed_link(dp->dn) || phy_np) {
>                         if (ds->ops->phylink_mac_link_down)
>                                 ds->ops->phylink_mac_link_down(ds, port,
>                                         MLO_AN_FIXED, PHY_INTERFACE_MODE_NA);
>                         return dsa_port_phylink_register(dp);
> 
> which forces the link down, and for some reason the link never comes
> back up.
>
> One of the issues here is of_phy_is_fixed_link() - it is dangerous.
> The function name leads you astray - it suggests that if it returns
> true, then you have a fixed link, but it also returns true of you
> have managed!="auto" in DT, so it's actually fixed-or-inband-link.
> 
> Andrew, any thoughts?


Hi Russell

I think that is my change, if i remember correctly. Something to do
with phylink assuming all interfaces are down to begin with. But DSA
and CPU links were defaulting to up. When phylink later finds the
fixed-link it then configures the interface up again, and because the
interface is up, nothing actually happens, or it ends up in the wrong
mode. So i think my intention was, if there is a fixed link in DT,
down the interface before registering it with phylink, so its
assumptions are true, and it will later be correctly configured up.

So in this case, do you think we are falling into the trap of
managed!="auto" ?

	Andrew

  reply	other threads:[~2020-07-17 19:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-11 13:50 bug: net: dsa: mv88e6xxx: unable to tx or rx with Clearfog GT 8K (with git bisect) Martin Rowe
2020-07-11 16:23 ` Andrew Lunn
2020-07-11 19:22   ` Russell King - ARM Linux admin
2020-07-12 13:00     ` Martin Rowe
2020-07-12 13:25       ` Russell King - ARM Linux admin
2020-07-17  5:56         ` Martin Rowe
2020-07-17  9:21           ` Russell King - ARM Linux admin
2020-07-17 12:50             ` Martin Rowe
2020-07-17 18:51               ` Russell King - ARM Linux admin
2020-07-17 19:42                 ` Andrew Lunn [this message]
2020-07-17 21:26                   ` Russell King - ARM Linux admin
2020-07-18  2:37                     ` Martin Rowe
2020-07-18  8:50                       ` Russell King - ARM Linux admin
2020-07-18  9:43                         ` Martin Rowe
2020-07-18 10:12                           ` Russell King - ARM Linux admin
2020-07-18 11:21                             ` Martin Rowe
2020-07-18 11:26                               ` Russell King - ARM Linux admin

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=20200717194237.GE1339445@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=linux@armlinux.org.uk \
    --cc=martin.p.rowe@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.com \
    /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).