netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Martyn Welch <martyn.welch@collabora.com>,
	Andrew Lunn <andrew@lunn.ch>,
	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: Tue, 7 Dec 2021 16:37:05 +0200	[thread overview]
Message-ID: <20211207143705.46fd2zavniwb3gri@skbuf> (raw)
In-Reply-To: <Ya9op2QJwWRyqmDY@shell.armlinux.org.uk>

On Tue, Dec 07, 2021 at 01:59:03PM +0000, Russell King (Oracle) wrote:
> The change that I have proposed is based on two patches:
> 
> 1) Change mv88e6xxx_port_ppu_updates() to behave sensibly for the 6250
>    family of DSA switches.
> 
> 2) Un-force the link-down in mv88e6xxx_mac_config()
> 
> This gives us more consistency. The checks become:
> 
> a) mac_link_down():
> 
>         if ((!mv88e6xxx_port_ppu_updates(chip, port) ||
>              mode == MLO_AN_FIXED) && ops->port_sync_link)
>                 err = ops->port_sync_link(chip, port, mode, false);
> 
> b) mac_link_up():
> 
>         if (!mv88e6xxx_port_ppu_updates(chip, port) ||
>             mode == MLO_AN_FIXED) {
> ...
>                 if (ops->port_sync_link)
>                         err = ops->port_sync_link(chip, port, mode, true);
>         }
> 
> c) mac_config():
> 
>         if (chip->info->ops->port_set_link &&
>             ((mode == MLO_AN_INBAND && p->interface != state->interface) ||
>              (mode == MLO_AN_PHY && mv88e6xxx_port_ppu_updates(chip, port))))
>                 chip->info->ops->port_set_link(chip, port, LINK_UNFORCED);
> 
> The "(mode == MLO_AN_INBAND && p->interface != state->interface)"
> expression comes from the existing code, so isn't something that
> needs discussion.
> 
> We want to preserve the state of the link-force for MLO_AN_FIXED,
> so the only case for discussion is the new MLO_AN_PHY. It can be
> seen that all three methods above end up using the same decision,
> and essentially if mv88e6xxx_port_ppu_updates() is true, meaning
> there is a non-software method to handle the status updates, then
> we (a) don't do any forcing in the mac_link_*() methods and turn
> off the forcing in mac_config().

Ok, so if we are in:
- MLO_AN_PHY (internal or external) and PPU enabled, we're letting the link unforced in mac_config
- MLO_AN_PHY (internal or external) and PPU disabled, we're forcing the link up in mac_link_up,
  via the "!mv88e6xxx_port_ppu_updates()" check.
- MLO_AN_FIXED, we're also forcing the link up in mac_link_up, via the
  "mode == MLO_AN_FIXED" check.

So in Martyn's case, a CPU port internal PHY link which is forced down
in mac_link_down would either be forced up or unforced, but never be
left the way in which mac_link_down put it. That is good and appears
robust.

Although it isn't strictly true that "[ if ] there is a non-software
method to handle the status updates, then we don't do any forcing in
the mac_link_*() methods", because technically we still do in
mac_link_down, due to the " || mode == MLO_AN_FIXED" condition plus the
way in which we are called, it's just that we undo it later.

  reply	other threads:[~2021-12-07 14: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
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 [this message]
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=20211207143705.46fd2zavniwb3gri@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@collabora.com \
    --cc=linux@armlinux.org.uk \
    --cc=martyn.welch@collabora.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).