* [PATCH net-next] net: dsa: sja1105: move MAC configuration to .phylink_mac_link_up
@ 2020-03-12 12:19 Russell King
2020-03-15 3:50 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Russell King @ 2020-03-12 12:19 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, Heiner Kallweit
Cc: David S. Miller, netdev, Vladimir Oltean, Vivien Didelot
From: Vladimir Oltean <olteanv@gmail.com>
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>
---
drivers/net/dsa/sja1105/sja1105_main.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c
index 6fe679143216..2deb9c5e3ef7 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,
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: dsa: sja1105: move MAC configuration to .phylink_mac_link_up
2020-03-12 12:19 [PATCH net-next] net: dsa: sja1105: move MAC configuration to .phylink_mac_link_up Russell King
@ 2020-03-15 3:50 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-03-15 3:50 UTC (permalink / raw)
To: rmk+kernel
Cc: andrew, f.fainelli, hkallweit1, netdev, olteanv, vivien.didelot
From: Russell King <rmk+kernel@armlinux.org.uk>
Date: Thu, 12 Mar 2020 12:19:51 +0000
> From: Vladimir Oltean <olteanv@gmail.com>
>
> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-15 3:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-12 12:19 [PATCH net-next] net: dsa: sja1105: move MAC configuration to .phylink_mac_link_up Russell King
2020-03-15 3:50 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.