summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Oltean <olteanv@gmail.com>2020-02-29 23:06:55 +0200
committerRussell King <rmk+kernel@armlinux.org.uk>2020-04-02 19:45:17 +0100
commita8d96f543c4bd45eb3ed00d8dc96bcb2a4c1de0d (patch)
treee2d4c9358d5e50dd59c12989201502df32eeb694
parentc80b5e4a2e787bb7b2dfff85fc2b192fd630663b (diff)
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 <olteanv@gmail.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--drivers/net/dsa/sja1105/sja1105_main.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c
index a3709f7ad0e2..65925f5f6b84 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,