diff options
author | Antoine Tenart <antoine.tenart@bootlin.com> | 2018-09-19 11:39:31 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-19 21:15:01 -0700 |
commit | aeeb2e8fdefdd5d257a1446351c70cb3df540199 (patch) | |
tree | 278f23ca831a60e533a761338e8ff7e331a9b015 /drivers/net/phy/phylink.c | |
parent | 02f7f61e5af2fa4748d610b8e4b1af70a44dcbe3 (diff) | |
download | linux-stable-aeeb2e8fdefdd5d257a1446351c70cb3df540199.tar.gz linux-stable-aeeb2e8fdefdd5d257a1446351c70cb3df540199.tar.bz2 linux-stable-aeeb2e8fdefdd5d257a1446351c70cb3df540199.zip |
net: phy: phylink: ensure the carrier is off when starting phylink
Phylink made an assumption about the carrier state being down when
calling phylink_start(). If this assumption isn't satisfied, the
internal phylink state could misbehave and a net device could end up not
being functional.
This patch fixes this by explicitly calling netif_carrier_off() in
phylink_start().
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phylink.c')
-rw-r--r-- | drivers/net/phy/phylink.c | 3 |
1 files changed, 3 insertions, 0 deletions
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. |