netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Martyn Welch <martyn.welch@collabora.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	netdev@vger.kernel.org, kernel@collabora.com,
	Russell King <rmk+kernel@armlinux.org.uk>
Subject: Re: mv88e6240 configuration broken for B850v3
Date: Mon, 6 Dec 2021 21:37:30 +0200	[thread overview]
Message-ID: <20211206193730.oubyveywniyvptfk@skbuf> (raw)
In-Reply-To: <3d6c6226e47374cf92d604bc6c711e59d76e3175.camel@collabora.com>

On Mon, Dec 06, 2021 at 07:24:56PM +0000, Martyn Welch wrote:
> On Mon, 2021-12-06 at 20:50 +0200, Vladimir Oltean wrote:
> > On Mon, Dec 06, 2021 at 06:37:44PM +0000, Martyn Welch wrote:
> > > On Mon, 2021-12-06 at 20:31 +0200, Vladimir Oltean wrote:
> > > > On Mon, Dec 06, 2021 at 06:26:25PM +0000, Martyn Welch wrote:
> > > > > On Mon, 2021-12-06 at 17:44 +0000, Martyn Welch wrote:
> > > > > > On Fri, 2021-12-03 at 17:25 +0100, Andrew Lunn wrote:
> > > > > > > > Hi Andrew,
> > > > > > > 
> > > > > > > Adding Russell to Cc:
> > > > > > > 
> > > > > > > > I'm currently in the process of updating the GE B850v3
> > > > > > > > [1] to
> > > > > > > > run
> > > > > > > > a
> > > > > > > > newer kernel than the one it's currently running. 
> > > > > > > 
> > > > > > > Which kernel exactly. We like bug reports against net-next,
> > > > > > > or
> > > > > > > at
> > > > > > > least the last -rc.
> > > > > > > 
> > > > > > 
> > > > > > I tested using v5.15-rc3 and that was also affected.
> > > > > > 
> > > > > 
> > > > > I've just tested v5.16-rc4 (sorry - just realised I previously
> > > > > wrote
> > > > > v5.15-rc3, it was v5.16-rc3...) and that was exactly the same.
> > > > 
> > > > Just to clarify: you're saying that you're on v5.16-rc4 and that
> > > > if
> > > > you
> > > > revert commit 3be98b2d5fbc ("net: dsa: Down cpu/dsa ports phylink
> > > > will
> > > > control"), the link works again?
> > > > 
> > > 
> > > Correct
> > > 
> > > > It is a bit strange that the external ports negotiate at
> > > > 10Mbps/Full,
> > > > is that the link speed you intend the ports to work at?
> > > 
> > > Yes, that's 100% intentional due to what's connected to to those
> > > ports
> > > and the environment it works in.
> > > 
> > > Martyn
> > 
> > Just out of curiosity, can you try this change? It looks like a
> > simple
> > case of mismatched conditions inside the mv88e6xxx driver between
> > what
> > is supposed to force the link down and what is supposed to force it
> > up:
> > 
> > diff --git a/net/dsa/port.c b/net/dsa/port.c
> > index 20f183213cbc..d235270babf7 100644
> > --- a/net/dsa/port.c
> > +++ b/net/dsa/port.c
> > @@ -1221,7 +1221,7 @@ int dsa_port_link_register_of(struct dsa_port
> > *dp)
> >                 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);
> > +                                       MLO_AN_PHY, PHY_INTERFACE_MODE_NA);
> >                         return dsa_port_phylink_register(dp);
> >                 }
> >                 return 0;
> 
> Yes, that appears to also make it work.
> 
> Martyn

Well, I just pointed out what the problem is, I don't know how to solve
it, honest! :)

It's clear that the code is wrong, because it's in an "if" block that
checks for "of_phy_is_fixed_link(dp->dn) || phy_np" but then it omits
the "phy_np" part of it. On the other hand we can't just go ahead and
say "if (phy_np) mode = MLO_AN_PHY; else mode = MLO_AN_FIXED;" because
MLO_AN_INBAND is also a valid option that we may be omitting. So we'd
have to duplicate part of the logic from phylink_parse_mode(), which
does not appear ideal at all. What would be ideal is if this fabricated
phylink call would not be done at all, but I don't know enough about the
systems that need it, I expect Andrew knows more.

  reply	other threads:[~2021-12-06 19:37 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03  9:06 mv88e6240 configuration broken for B850v3 Martyn Welch
2021-12-03 16:25 ` Andrew Lunn
2021-12-06 17:44   ` Martyn Welch
2021-12-06 18:26     ` Martyn Welch
2021-12-06 18:31       ` Vladimir Oltean
2021-12-06 18:37         ` Martyn Welch
2021-12-06 18:50           ` Vladimir Oltean
2021-12-06 19:24             ` Martyn Welch
2021-12-06 19:37               ` Vladimir Oltean [this message]
2021-12-06 19:53                 ` Andrew Lunn
2021-12-06 20:01                   ` Vladimir Oltean
2021-12-06 20:18                     ` Russell King (Oracle)
2021-12-06 20:29                       ` Vladimir Oltean
2021-12-07 14:09                         ` Andrew Lunn
2021-12-06 21:44                       ` Vladimir Oltean
2021-12-06 22:13                         ` Russell King (Oracle)
2021-12-06 20:07                 ` Russell King (Oracle)
2021-12-06 20:23                   ` Vladimir Oltean
2021-12-06 20:51                     ` Russell King (Oracle)
2021-12-06 21:13                       ` Vladimir Oltean
2021-12-06 21:27                         ` Russell King (Oracle)
2021-12-06 21:49                           ` Russell King (Oracle)
2021-12-06 23:27                             ` Vladimir Oltean
2021-12-07  0:58                               ` Russell King (Oracle)
2021-12-07 13:24                                 ` Vladimir Oltean
2021-12-07 13:59                                   ` Russell King (Oracle)
2021-12-07 14:37                                     ` Vladimir Oltean
2021-12-07 14:53                                       ` Russell King (Oracle)
2021-12-06 21:51                           ` Vladimir Oltean
2021-12-06 22:17                             ` Andrew Lunn
2021-12-06 22:22                             ` Russell King (Oracle)
2021-12-06 23:44                               ` Vladimir Oltean
2021-12-07  2:06                                 ` Andrew Lunn
2021-12-07 12:48                                   ` Vladimir Oltean

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=20211206193730.oubyveywniyvptfk@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@collabora.com \
    --cc=martyn.welch@collabora.com \
    --cc=netdev@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    --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).