summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-09-20 06:15:02 +0200
committerDavid S. Miller <davem@davemloft.net>2018-09-20 06:15:02 +0200
commitdb161d930a194b05efa0129978d7ec5d6dea6fb5 (patch)
tree39fd86f720388b7ab75008a19ca0a0e4f008a5c7
parentMerge branch 'net-mvpp2-improve-the-interrupt-usage' (diff)
parentnet: mvneta: do not explicitly set the carrier state in open (diff)
downloadlinux-db161d930a194b05efa0129978d7ec5d6dea6fb5.tar.xz
linux-db161d930a194b05efa0129978d7ec5d6dea6fb5.zip
Merge branch 'phylink-ensure-the-carrier-is-off-when-starting-phylink'
Antoine Tenart says: ==================== net: phy: phylink: ensure the carrier is off when starting phylink Following the discussion we had regarding the phylink issue related to the carrier link state not being off when starting phylink, I sent a fix patch a few days ago for the PPv2 driver: https://lkml.org/lkml/2018/9/14/633 The idea was to send a patch which could go to the stable branches, but a better solution would be to directly call netif_carrier_off() from within phylink_start(). This is the aim of this series. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/marvell/mvneta.c3
-rw-r--r--drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c1
-rw-r--r--drivers/net/phy/phylink.c3
3 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index fe3edb3c2bf4..89ed1df7b3e7 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3791,9 +3791,6 @@ static int mvneta_open(struct net_device *dev)
goto err_free_online_hp;
}
- /* In default link is down */
- netif_carrier_off(pp->dev);
-
ret = mvneta_mdio_probe(pp);
if (ret < 0) {
netdev_err(dev, "cannot probe MDIO bus\n");
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index 6dc15a234e50..03ff053b1d8c 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -3193,7 +3193,6 @@ static void mvpp2_start_dev(struct mvpp2_port *port)
mvpp22_mode_reconfigure(port);
if (port->phylink) {
- netif_carrier_off(port->dev);
phylink_start(port->phylink);
} else {
/* Phylink isn't used as of now for ACPI, so the MAC has to be
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 3ba5cf2a8a5f..1d01e0c625a5 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -901,6 +901,9 @@ void phylink_start(struct phylink *pl)
phylink_an_mode_str(pl->link_an_mode),
phy_modes(pl->link_config.interface));
+ /* Always set the carrier off */
+ netif_carrier_off(pl->netdev);
+
/* Apply the link configuration to the MAC when starting. This allows
* a fixed-link to start with the correct parameters, and also
* ensures that we set the appropriate advertisement for Serdes links.