Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Linus Walleij <linus.walleij@linaro.org>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net: dsa: mark parsed interface mode for legacy switch drivers
Date: Thu, 17 Aug 2023 21:01:29 +0300	[thread overview]
Message-ID: <20230817180129.krlht3anaa752w46@skbuf> (raw)
In-Reply-To: <ZNtPswQl8fvnlGyf@shell.armlinux.org.uk>

Hi Russell,

On Tue, Aug 15, 2023 at 11:13:07AM +0100, Russell King (Oracle) wrote:
> There is one case that I have missed, and it's totally screwed by
> this behaviour where a Marvell DSA switch is connected to a Marvell
> PHY via a RGMII connection:
> 
>    DSA <---------------------------------> PHY
>     v					    v
> dt-dsa-node {				phy: dt-phy-node {
>   phy-handle = <&phy>;			  ...
>   phy-mode = "rgmii-foo";		};
> };
> 
> parses phy mode
> configures for RGMII mode
> configures RGMII delays associated
>  with phy-mode
> calls phy_attach(..., mode);
> phylib sets phy_dev->interface
> 					PHY driver looks at
> 					phydev->interface and
> 					configures delays
> 
> In this case, we have *both* ends configuring the RGMII delays and it
> will not work - because having the DSA MAC end configure the delays
> breaks the phylib model where the MAC *shouldn't* be configuring the
> delays.
> 
> So, should mv88e6xxx_mac_config() also be forcing all RGMII modes
> in state->interface to be PHY_INTERFACE_MODE_RGMII when passing
> that into mv88e6xxx_port_config_interface() if, and only if the
> port is a user port? Or maybe if and only if the port is actually
> connected to a real PHY?

I'd tend to believe that you're right, this would be broken (and not
just with Marvell RGMII PHYs).

I was under the impression that mv88e6xxx_mac_config() will only
configure the RGMII delays associated with phy-mode if the port is in
fixed-link mode.

But looking at the actual condition upon which mv88e6xxx_mac_config()
decides to call mv88e6xxx_port_config_interface(), that is:

	if (mode != MLO_AN_PHY || !mv88e6xxx_phy_is_internal(chip, port))
		mv88e6xxx_port_config_interface()

and thus, an external PHY would return false for the first term of the
OR operation, but true for the second, and it would proceed to configure
the MAC-side RGMII delays, resulting in a double delay.

However, I am not fully confident in my analysis, since I don't have
mv88e6xxx hardware with an RGMII port to confirm.

It's interesting that we haven't seen reports?

  reply	other threads:[~2023-08-17 18:01 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08 11:12 [PATCH net-next] net: dsa: mark parsed interface mode for legacy switch drivers Russell King (Oracle)
2023-08-08 12:06 ` Vladimir Oltean
2023-08-08 12:30   ` Russell King (Oracle)
2023-08-08 12:39     ` Vladimir Oltean
2023-08-08 12:57       ` Russell King (Oracle)
2023-08-08 13:52         ` Vladimir Oltean
2023-08-08 14:19           ` Russell King (Oracle)
2023-08-10 15:16             ` Vladimir Oltean
2023-08-12 12:16               ` Russell King (Oracle)
2023-08-13 10:50                 ` Vladimir Oltean
2023-08-13 21:56                 ` Linus Walleij
2023-08-13 22:17                   ` Russell King (Oracle)
2023-08-15  6:41                   ` Linus Walleij
2023-08-14 14:59                 ` Vladimir Oltean
2023-08-14 15:12                   ` Russell King (Oracle)
2023-08-14 15:46                     ` Andrew Lunn
2023-08-14 16:27                       ` Russell King (Oracle)
2023-08-14 17:05                         ` Andrew Lunn
2023-08-14 22:03                           ` Russell King (Oracle)
2023-08-14 23:33                             ` Andrew Lunn
2023-08-15 10:13                             ` Russell King (Oracle)
2023-08-17 18:01                               ` Vladimir Oltean [this message]
2023-08-17 18:19                             ` Vladimir Oltean
2023-08-17 18:27                           ` Vladimir Oltean
2023-08-17 18:52                             ` Andrew Lunn
2023-08-17 19:17                               ` Vladimir Oltean
2023-08-18 11:11                                 ` Russell King (Oracle)
2023-08-18 11:40                                   ` Vladimir Oltean
2023-08-18 13:08                                     ` Linus Walleij
2023-08-18 13:29                                       ` Russell King (Oracle)
2023-08-18 16:06                                         ` Linus Walleij
2023-08-18 13:44                                       ` Vladimir Oltean
2023-08-18 13:10                                     ` Russell King (Oracle)
2023-08-18 14:21                                       ` Vladimir Oltean
2023-08-18 16:49                                         ` Vladimir Oltean
2023-08-14 22:21                         ` Linus Walleij
2023-08-14 15:47                     ` Vladimir Oltean
2023-08-08 16:35         ` Andrew Lunn
2023-08-08 12:39 ` Vladimir Oltean
2023-08-09 20:20 ` patchwork-bot+netdevbpf

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=20230817180129.krlht3anaa752w46@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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