OSDN Git Service

net: phy: phylink: ensure the carrier is off when starting phylink
authorAntoine Tenart <antoine.tenart@bootlin.com>
Wed, 19 Sep 2018 09:39:31 +0000 (11:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:08:27 +0000 (11:08 -0800)
commit15b08daa2111dfecdd9a7bee255584a3e96bd84a
treebe5fc5abecefeb451777862c9bbe955fefff4a51
parentf9573e11a9d67facd33dc235b1e7940aaa5c7d79
net: phy: phylink: ensure the carrier is off when starting phylink

[ Upstream commit aeeb2e8fdefdd5d257a1446351c70cb3df540199 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/phylink.c