aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Machon <daniel.machon@microchip.com>2024-12-20 14:48:44 +0100
committerJakub Kicinski <kuba@kernel.org>2024-12-23 10:57:55 -0800
commit9b8d70ecfef7abcabe265be4faeb07e552383520 (patch)
tree3ed07a5136b40704704d9e6ae2e2841cefe81f3a
parentnet: sparx5: skip low-speed configuration when port is RGMII (diff)
downloadlinux-9b8d70ecfef7abcabe265be4faeb07e552383520.tar.gz
linux-9b8d70ecfef7abcabe265be4faeb07e552383520.zip
net: sparx5: only return PCS for modes that require it
The RGMII ports have no PCS to configure. Make sure we only return the PCS for port modes that require it. Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Tested-by: Robert Marko <robert.marko@sartura.hr> Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Link: https://patch.msgid.link/20241220-sparx5-lan969x-switch-driver-4-v5-5-fa8ba5dff732@microchip.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c b/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c
index f8562c1a894d..035d2f1bea0d 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c
@@ -32,7 +32,19 @@ sparx5_phylink_mac_select_pcs(struct phylink_config *config,
{
struct sparx5_port *port = netdev_priv(to_net_dev(config->dev));
- return &port->phylink_pcs;
+ /* Return the PCS for all the modes that require it. */
+ switch (interface) {
+ case PHY_INTERFACE_MODE_SGMII:
+ case PHY_INTERFACE_MODE_QSGMII:
+ case PHY_INTERFACE_MODE_1000BASEX:
+ case PHY_INTERFACE_MODE_2500BASEX:
+ case PHY_INTERFACE_MODE_5GBASER:
+ case PHY_INTERFACE_MODE_10GBASER:
+ case PHY_INTERFACE_MODE_25GBASER:
+ return &port->phylink_pcs;
+ default:
+ return NULL;
+ }
}
static void sparx5_phylink_mac_config(struct phylink_config *config,