From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
Martyn Welch <martyn.welch@collabora.com>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
netdev@vger.kernel.org, kernel@collabora.com
Subject: Re: mv88e6240 configuration broken for B850v3
Date: Mon, 6 Dec 2021 22:13:22 +0000 [thread overview]
Message-ID: <Ya6LAmB3GswfYqB7@shell.armlinux.org.uk> (raw)
In-Reply-To: <20211206214428.qaavetaml2thggqo@skbuf>
On Mon, Dec 06, 2021 at 11:44:28PM +0200, Vladimir Oltean wrote:
> On Mon, Dec 06, 2021 at 08:18:30PM +0000, Russell King (Oracle) wrote:
> > > If we're going to impersonate phylink we could at least provide the same
> > > arguments as phylink will.
> >
> > What is going on here in terms of impersonation is entirely reasonable.
> >
> > The only things in this respect that phylink guarantees are:
> >
> > 1) The MAC/PCS configuration will not be substantially reconfigured
> > unless a call to mac_link_down() was made if a call to mac_link_up()
> > was previously made.
>
> The wording here is unclear. Did you mean "When the MAC/PCS configuration
> is substantially reconfigured and the last call was a mac_link_up(), a
> follow-up call to mac_link_down() will also be made"?
> And what do you mean by "substantially reconfigured"?
I mean what the documentation refers to as a "full initialisation" of
the link, which happens if we have to change the interface mode or
MLO_AN mode. Only minor changes (advertisements or pause modes if under
manual control) will be changed without a prior call to mac_link_down().
For example, phylink will _never_ do:
mac_link_up()
mac_prepare()
mac_config()
pcs_config()
mac_finish()
mac_link_up()
However, with legacy (pre-March 2020) users, it _may_ do:
mac_link_up()
mac_config() (e.g. changing the in-band advertisement)
mac_an_restart()
The problem here is the legacy stuff which clouds the picture by making
extra calls to mac_config() when we're only changing things like the
in-band advert.
> phylink_major_config called from the paths that aren't phylink_mac_initial_config
> (because that happens with no preceding call to either mac_link_down or
> mac_link_up), right?
Where we call phylink_major_config(), we ensure that if we know the link
was previously up, we make a call to mac_link_down() first.
> > 2) The arguments to mac_link_down() will be the same as the preceeding
> > mac_link_up() call - in other words, the "mode" and "interface".
>
> Does this imply that "there will always be a preceding mac_link_up to
> every mac_link_down call"?
From the design of phylink, yes it does, since phylink assumes that the
link is initially down.
> Because if it does imply that, DSA violates it.
Yes, DSA violates that, but DSA is free to do that if it makes sense,
and from what I understand of DSA, this is a special case. From what
I've seen with Marvell DSA, they start off auto-configuring the
inter-switch and CPU ports in link-up mode, whereas phylink assumes
that the link is down.
When DSA sets stuff up and brings up the CPU port, the very first
thing that phylink does is reconfigure the port - but the port is in
link-up mode, and that can mess up the port. So Andrew introduced
this to fix it. See commit 3be98b2d5fbc.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2021-12-06 22:13 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
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) [this message]
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=Ya6LAmB3GswfYqB7@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=f.fainelli@gmail.com \
--cc=kernel@collabora.com \
--cc=martyn.welch@collabora.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--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).