All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Daniel Mack <daniel@zonque.org>
Cc: netdev@vger.kernel.org, vivien.didelot@gmail.com, andrew@lunn.ch,
	f.fainelli@gmail.com
Subject: Re: [PATCH] net: dsa: mv88e6xxx: Allow MAC configuration for ports with internal PHY
Date: Mon, 22 Jun 2020 19:52:41 +0100	[thread overview]
Message-ID: <20200622185241.GM1551@shell.armlinux.org.uk> (raw)
In-Reply-To: <20200622183443.3355240-1-daniel@zonque.org>

On Mon, Jun 22, 2020 at 08:34:43PM +0200, Daniel Mack wrote:
> Ports with internal PHYs that are not in 'fixed-link' mode are currently
> only set up once at startup with a static config. Attempts to change the
> link speed or duplex settings are currently prevented by an early bail
> in mv88e6xxx_mac_config(). As the default config forces the speed to
> 1000M, setups with reduced link speed on such ports are unsupported.
> 
> Change that, and allow the configuration of all ports with the passed
> settings.
> 
> Signed-off-by: Daniel Mack <daniel@zonque.org>
> ---
> Russell,
> 
> This changes the behaviour implemented in c9a2356f35409a ("net:
> dsa: mv88e6xxx: add PHYLINK support"). Do you recall why your code
> didn't touch the MLO_AN_PHY mode links in the first place?

The reason is that's how it was before - each port with a PHY has
PHY polling enabled, which means that the PPU (phy polling unit)
reads the PHY state and updates the port with that.  The port
follows whatever the state of the PHY, and that does not require
phylink to program the port.

I believe it to be incorrect to force ports where the PPU is
enabled, and since Marvell DSA switches have always had the PPU
enabled, it is incorrect to force these ports.

Note that there was no change in behaviour - the code was originally
doing this prior to phylink:

static void mv88e6xxx_adjust_link(struct dsa_switch *ds, int port,
                                  struct phy_device *phydev)
{
        struct mv88e6xxx_chip *chip = ds->priv;
        int err;

        if (!phy_is_pseudo_fixed_link(phydev))
                return;

        mutex_lock(&chip->reg_lock);
        err = mv88e6xxx_port_setup_mac(chip, port, phydev->link, phydev->speed,
                                       phydev->duplex, phydev->interface);
        mutex_unlock(&chip->reg_lock);

        if (err && err != -EOPNOTSUPP)
                dev_err(ds->dev, "p%d: failed to configure MAC\n", port);
}

So the internal PHYs (phys which are not a pseudo fixed-link) were
being ignored before my code.

As is normal for me, when ever I convert something from one thing to
another, I try to preserve as much of the original behaviour as
possible, and with regard to the issue that you raise, I preserved
the behaviour for the internal PHYs.

Hence, I believe your patch to be incorrect.

What problem are you seeing, and with which switch?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

      parent reply	other threads:[~2020-06-22 18:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 18:34 [PATCH] net: dsa: mv88e6xxx: Allow MAC configuration for ports with internal PHY Daniel Mack
2020-06-22 18:41 ` Andrew Lunn
2020-06-22 18:44   ` Daniel Mack
2020-06-22 18:52     ` Andrew Lunn
2020-06-22 18:58     ` Russell King - ARM Linux admin
2020-06-22 19:16       ` Daniel Mack
2020-06-22 19:29         ` Andrew Lunn
2020-06-22 19:43         ` Russell King - ARM Linux admin
2020-06-22 19:50           ` Daniel Mack
2020-06-22 18:52 ` Russell King - ARM Linux admin [this message]

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=20200622185241.GM1551@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=daniel@zonque.org \
    --cc=f.fainelli@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.