From: Vladimir Oltean Date: Thu, 12 Mar 2020 12:19:51 +0000 (+0000) Subject: net: dsa: sja1105: move MAC configuration to .phylink_mac_link_up X-Git-Tag: v5.15~4200^2~171 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec8582d1349a3d984a0369c1573ae5c2a7acd0ed;p=platform%2Fkernel%2Flinux-starfive.git net: dsa: sja1105: move MAC configuration to .phylink_mac_link_up The switches supported so far by the driver only have non-SerDes ports, so they should be configured in the PHYLINK callback that provides the resolved PHY link parameters. Signed-off-by: Vladimir Oltean Signed-off-by: Russell King Signed-off-by: David S. Miller --- diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c index d42f085..d812328 100644 --- a/drivers/net/dsa/sja1105/sja1105_main.c +++ b/drivers/net/dsa/sja1105/sja1105_main.c @@ -765,15 +765,16 @@ static void sja1105_mac_config(struct dsa_switch *ds, int port, { struct sja1105_private *priv = ds->priv; - if (sja1105_phy_mode_mismatch(priv, port, state->interface)) + if (sja1105_phy_mode_mismatch(priv, port, state->interface)) { + dev_err(ds->dev, "Changing PHY mode to %s not supported!\n", + phy_modes(state->interface)); return; + } if (link_an_mode == MLO_AN_INBAND) { dev_err(ds->dev, "In-band AN not supported!\n"); return; } - - sja1105_adjust_port_config(priv, port, state->speed); } static void sja1105_mac_link_down(struct dsa_switch *ds, int port, @@ -790,7 +791,11 @@ static void sja1105_mac_link_up(struct dsa_switch *ds, int port, int speed, int duplex, bool tx_pause, bool rx_pause) { - sja1105_inhibit_tx(ds->priv, BIT(port), false); + struct sja1105_private *priv = ds->priv; + + sja1105_adjust_port_config(priv, port, speed); + + sja1105_inhibit_tx(priv, BIT(port), false); } static void sja1105_phylink_validate(struct dsa_switch *ds, int port,