Skip to contentSkip to conversation

net: dsa: microchip: Support GMII on user ports

PATCH In review Marek Vasut 2 participants 3 messages Aug 23, 2022

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

PATCH 1/1 net: dsa: microchip: Support GMII on user ports

The user ports on KSZ879x indicate they are of GMII interface type instead of INTERNAL interface type. Add GMII into the list of supported user port interfaces to avoid the following failure on probe:

"
ksz8795-switch spi0.0 lan1 (uninitialized): validation of gmii with support 0000000,00000000,000062cf and advertisement 0000000,00000000,000062cf failed: -EINVAL ksz8795-switch spi0.0 lan1 (uninitialized): failed to connect to PHY: -EINVAL
ksz8795-switch spi0.0 lan1 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 0
"

---
Cc: Arun Ramadoss <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Vladimir Oltean <[email protected]>

---
 drivers/net/dsa/microchip/ksz_common.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/dsa/microchip/ksz_common.c +4 -1
index ed7d137cba994..4a77c8b0e664e 100644
@@ -803,9 +803,12 @@ static void ksz_phylink_get_caps(struct dsa_switch *ds, int port,
 	if (dev->info->supports_rgmii[port])
 		phy_interface_set_rgmii(config->supported_interfaces);
 
-	if (dev->info->internal_phy[port])
+	if (dev->info->internal_phy[port]) {
+		__set_bit(PHY_INTERFACE_MODE_GMII,
+			  config->supported_interfaces);
 		__set_bit(PHY_INTERFACE_MODE_INTERNAL,
 			  config->supported_interfaces);
+	}
 
 	if (dev->dev_ops->get_caps)
 		dev->dev_ops->get_caps(dev, port, config);
Signature · 1 line
2.35.1
maintainer
#1 lore raw
Quoted 10 lines · Marek Vasut

The user ports on KSZ879x indicate they are of GMII interface type instead of INTERNAL interface type. Add GMII into the list of supported user port interfaces to avoid the following failure on probe:

"
ksz8795-switch spi0.0 lan1 (uninitialized): validation of gmii with support 0000000,00000000,000062cf and advertisement 0000000,00000000,000062cf failed: -EINVAL ksz8795-switch spi0.0 lan1 (uninitialized): failed to connect to PHY: -EINVAL
ksz8795-switch spi0.0 lan1 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 0
"

Quoted 6 lines

---
Cc: Arun Ramadoss <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Vladimir Oltean <[email protected]>

https://lore.kernel.org/netdev/[email protected]/

#2 lore raw
Quoted 11 lines · Vladimir Oltean
Quoted 10 lines · Marek Vasut

The user ports on KSZ879x indicate they are of GMII interface type instead of INTERNAL interface type. Add GMII into the list of supported user port interfaces to avoid the following failure on probe:

"
ksz8795-switch spi0.0 lan1 (uninitialized): validation of gmii with support 0000000,00000000,000062cf and advertisement 0000000,00000000,000062cf failed: -EINVAL ksz8795-switch spi0.0 lan1 (uninitialized): failed to connect to PHY: -EINVAL
ksz8795-switch spi0.0 lan1 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 0
"

Quoted 8 lines
Quoted 6 lines

---
Cc: Arun Ramadoss <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Vladimir Oltean <[email protected]>

https://lore.kernel.org/netdev/[email protected]/

Nice, thanks !