Skip to contentSkip to conversation

net: dsa: mv88e6xxx: support RGMII cmode

PATCH Applied Marcus Carlberg 5 participants 8 messages Aug 22, 2022 – Aug 27, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 net: dsa: mv88e6xxx: support RGMII cmode

Since the probe defaults all interfaces to the highest speed possible (10GBASE-X in mv88e6393x) before the phy mode configuration from the devicetree is considered it is currently impossible to use port 0 in RGMII mode.

This change will allow RGMII modes to be configurable for port 0 enabling port 0 to be configured as RGMII as well as serial depending on configuration.

Fixes de776d0d316f ("net: dsa: mv88e6xxx: add support for mv88e6393x family")

---

Notes:
v2: add phy mode input validation for SERDES only ports

v3: add RGMII phy interface types to supported phy modes list.
add fixes tag.

 drivers/net/dsa/mv88e6xxx/chip.c |  8 ++++++++
 drivers/net/dsa/mv88e6xxx/port.c | 19 +++++++++++++++++++
 2 files changed, 27 insertions(+)
drivers/net/dsa/mv88e6xxx/chip.c +8 -0
index 07e9a4da924c..6403f1f8bdbb 100644
@@ -816,6 +816,14 @@ static void mv88e6393x_phylink_get_caps(struct mv88e6xxx_chip *chip, int port,
 				MAC_10000FD;
 		}
 	}
+
+	if (port == 0) {
+		__set_bit(PHY_INTERFACE_MODE_RMII, supported);
+		__set_bit(PHY_INTERFACE_MODE_RGMII, supported);
+		__set_bit(PHY_INTERFACE_MODE_RGMII_ID, supported);
+		__set_bit(PHY_INTERFACE_MODE_RGMII_RXID, supported);
+		__set_bit(PHY_INTERFACE_MODE_RGMII_TXID, supported);
+	}
 }
 
 static void mv88e6xxx_get_caps(struct dsa_switch *ds, int port,
drivers/net/dsa/mv88e6xxx/port.c +19 -0
index 90c55f23b7c9..5c4195c635b0 100644
@@ -517,6 +517,12 @@ static int mv88e6xxx_port_set_cmode(struct mv88e6xxx_chip *chip, int port,
 	case PHY_INTERFACE_MODE_RMII:
 		cmode = MV88E6XXX_PORT_STS_CMODE_RMII;
 		break;
+	case PHY_INTERFACE_MODE_RGMII:
+	case PHY_INTERFACE_MODE_RGMII_ID:
+	case PHY_INTERFACE_MODE_RGMII_RXID:
+	case PHY_INTERFACE_MODE_RGMII_TXID:
+		cmode = MV88E6XXX_PORT_STS_CMODE_RGMII;
+		break;
 	case PHY_INTERFACE_MODE_1000BASEX:
 		cmode = MV88E6XXX_PORT_STS_CMODE_1000BASEX;
 		break;
@@ -634,6 +640,19 @@ int mv88e6393x_port_set_cmode(struct mv88e6xxx_chip *chip, int port,
 	if (port != 0 && port != 9 && port != 10)
 		return -EOPNOTSUPP;
 
+	if (port == 9 || port == 10) {
+		switch (mode) {
+		case PHY_INTERFACE_MODE_RMII:
+		case PHY_INTERFACE_MODE_RGMII:
+		case PHY_INTERFACE_MODE_RGMII_ID:
+		case PHY_INTERFACE_MODE_RGMII_RXID:
+		case PHY_INTERFACE_MODE_RGMII_TXID:
+			return -EINVAL;
+		default:
+			break;
+		}
+	}
+
 	/* mv88e6393x errata 4.5: EEE should be disabled on SERDES ports */
 	err = mv88e6xxx_port_read(chip, port, MV88E6XXX_PORT_MAC_CTL, &reg);
 	if (err)
Signature · 1 line
2.20.1
maintainer
#1 lore raw
Quoted 11 lines · On Mon, 22 Aug 2022 16:41:36 +0200 Marcus Carlberg wrote:

Since the probe defaults all interfaces to the highest speed possible (10GBASE-X in mv88e6393x) before the phy mode configuration from the devicetree is considered it is currently impossible to use port 0 in RGMII mode.

This change will allow RGMII modes to be configurable for port 0 enabling port 0 to be configured as RGMII as well as serial depending on configuration.

Fixes de776d0d316f ("net: dsa: mv88e6xxx: add support for mv88e6393x family")

Seems like a new configuration which was not previously supported rather than a regression, right? If so I'll drop the Fixes tag when applying.

#2 lore raw
Quoted 10 lines · On Thu, 25 Aug 2022 12:38:07 -0700 Jakub Kicinski <[email protected]> wrote:
Quoted 9 lines · On Mon, 22 Aug 2022 16:41:36 +0200 Marcus Carlberg wrote:

Since the probe defaults all interfaces to the highest speed possible (10GBASE-X in mv88e6393x) before the phy mode configuration from the devicetree is considered it is currently impossible to use port 0 in RGMII mode.

This change will allow RGMII modes to be configurable for port 0 enabling port 0 to be configured as RGMII as well as serial depending on configuration.

Quoted 6 lines
Quoted 2 lines
Fixes de776d0d316f ("net: dsa: mv88e6xxx: add support for mv88e6393x family")

Seems like a new configuration which was not previously supported rather than a regression, right? If so I'll drop the Fixes tag when applying.

Please leave the fixes tag. This configuration should have been supported from the beginning.

Marek

maintainer
#3 lore raw
Quoted 13 lines · On Fri, 26 Aug 2022 00:06:05 +0200 Marek Behún wrote:
Quoted 13 lines · On Mon, 22 Aug 2022 16:41:36 +0200 Marcus Carlberg wrote:
Quoted 11 lines

Since the probe defaults all interfaces to the highest speed possible (10GBASE-X in mv88e6393x) before the phy mode configuration from the devicetree is considered it is currently impossible to use port 0 in RGMII mode.

This change will allow RGMII modes to be configurable for port 0 enabling port 0 to be configured as RGMII as well as serial depending on configuration.

Fixes de776d0d316f ("net: dsa: mv88e6xxx: add support for mv88e6393x family")
Quoted 6 lines
Quoted 3 lines

Seems like a new configuration which was not previously supported rather than a regression, right? If so I'll drop the Fixes tag when applying.

Please leave the fixes tag. This configuration should have been supported from the beginning.

Could you explain why? Is there an upstream-supported platform already in Linus's tree which doesn't boot or something?

#4 lore raw
Quoted 18 lines · On Thu, 25 Aug 2022 15:51:40 -0700 Jakub Kicinski <[email protected]> wrote:
Quoted 17 lines · On Fri, 26 Aug 2022 00:06:05 +0200 Marek Behún wrote:
Quoted 16 lines · On Mon, 22 Aug 2022 16:41:36 +0200 Marcus Carlberg wrote:
Quoted 11 lines

Since the probe defaults all interfaces to the highest speed possible (10GBASE-X in mv88e6393x) before the phy mode configuration from the devicetree is considered it is currently impossible to use port 0 in RGMII mode.

This change will allow RGMII modes to be configurable for port 0 enabling port 0 to be configured as RGMII as well as serial depending on configuration.

Fixes de776d0d316f ("net: dsa: mv88e6xxx: add support for mv88e6393x family")

Seems like a new configuration which was not previously supported rather than a regression, right? If so I'll drop the Fixes tag when applying.

Quoted 5 lines
Quoted 2 lines

Please leave the fixes tag. This configuration should have been supported from the beginning.

Could you explain why? Is there an upstream-supported platform already in Linus's tree which doesn't boot or something?

If you mean whether there is a device-tree of such a device, they I don't think so, because AFAIK there isn't a device-tree with 6393 in upstream Linux other than CN9130-CRB.

But it is possible though that there is such a device which has everything but the switch supported on older kernels, due to this RGMII bug.

I think RGMII should have been supported on this switch when I send the patch adding support for it, and it is a bug that it is not, becuase RGMII is supported for similar switches driven by mv88e6xxx driver (6390, for example). I don't know why I overlooked it then.

Note that I wouldn't consider adding support for USXGMII a fix, because although the switch can do it, it was never done with this driver.

But if you think it doesn't apply anyway, remove the Fixes tag. This is just my opinion that it should stay.

Marek

maintainer
#5 lore raw
Quoted 16 lines · On Fri, 26 Aug 2022 01:26:59 +0200 Marek Behún wrote:
Quoted 2 lines

Could you explain why? Is there an upstream-supported platform already in Linus's tree which doesn't boot or something?

If you mean whether there is a device-tree of such a device, they I don't think so, because AFAIK there isn't a device-tree with 6393 in upstream Linux other than CN9130-CRB.

But it is possible though that there is such a device which has everything but the switch supported on older kernels, due to this RGMII bug.

I think RGMII should have been supported on this switch when I send the patch adding support for it, and it is a bug that it is not, becuase RGMII is supported for similar switches driven by mv88e6xxx driver (6390, for example). I don't know why I overlooked it then.

Quoted 5 lines

Note that I wouldn't consider adding support for USXGMII a fix, because although the switch can do it, it was never done with this driver.

But if you think it doesn't apply anyway, remove the Fixes tag. This is just my opinion that it should stay.

I see, I can only go by our general guidance of not treating omissions as fixes, but I lack the knowledge to be certain what's right here. Anyone willing to cast a tie-break vote? Andrew? net or net-next?

maintainer
#6 lore raw
Quoted 20 lines · Jakub Kicinski
Quoted 19 lines · On Fri, 26 Aug 2022 01:26:59 +0200 Marek Behún wrote:
Quoted 2 lines

Could you explain why? Is there an upstream-supported platform already in Linus's tree which doesn't boot or something?

If you mean whether there is a device-tree of such a device, they I don't think so, because AFAIK there isn't a device-tree with 6393 in upstream Linux other than CN9130-CRB.

But it is possible though that there is such a device which has everything but the switch supported on older kernels, due to this RGMII bug.

I think RGMII should have been supported on this switch when I send the patch adding support for it, and it is a bug that it is not, becuase RGMII is supported for similar switches driven by mv88e6xxx driver (6390, for example). I don't know why I overlooked it then.

Note that I wouldn't consider adding support for USXGMII a fix, because although the switch can do it, it was never done with this driver.

Quoted 6 lines
Quoted 2 lines

But if you think it doesn't apply anyway, remove the Fixes tag. This is just my opinion that it should stay.

I see, I can only go by our general guidance of not treating omissions as fixes, but I lack the knowledge to be certain what's right here. Anyone willing to cast a tie-break vote? Andrew? net or net-next?

Stable rules say:

o It must fix a real bug that bothers people (not a, “This could be a problem…” type thing).

We know anything with a Fixes: tag pretty much gets considered as a candidate for stable by the machine learning bot, even if we don't mark it so. So i would say drop the Fixes: tag, it does not fulfil the stable requirements.

Andrew

#7 lore raw
In reply to Marcus Carlberg
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Mon, 22 Aug 2022 16:41:36 +0200 you wrote:

Since the probe defaults all interfaces to the highest speed possible (10GBASE-X in mv88e6393x) before the phy mode configuration from the devicetree is considered it is currently impossible to use port 0 in RGMII mode.

This change will allow RGMII modes to be configurable for port 0 enabling port 0 to be configured as RGMII as well as serial depending on configuration.

[...]

Here is the summary with links:
- [v3] net: dsa: mv88e6xxx: support RGMII cmode

    https://git.kernel.org/netdev/net-next/c/1d2577ab0f05

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html