1 |
tmb |
1329221 |
From c1d0152023968af0a6cc2e423410e97bc22d4989 Mon Sep 17 00:00:00 2001 |
2 |
|
|
From: Antoine Tenart <antoine.tenart@bootlin.com> |
3 |
|
|
Date: Wed, 19 Sep 2018 11:39:31 +0200 |
4 |
|
|
Subject: [PATCH 056/145] net: phy: phylink: ensure the carrier is off when |
5 |
|
|
starting phylink |
6 |
|
|
|
7 |
|
|
[ Upstream commit aeeb2e8fdefdd5d257a1446351c70cb3df540199 ] |
8 |
|
|
|
9 |
|
|
Phylink made an assumption about the carrier state being down when |
10 |
|
|
calling phylink_start(). If this assumption isn't satisfied, the |
11 |
|
|
internal phylink state could misbehave and a net device could end up not |
12 |
|
|
being functional. |
13 |
|
|
|
14 |
|
|
This patch fixes this by explicitly calling netif_carrier_off() in |
15 |
|
|
phylink_start(). |
16 |
|
|
|
17 |
|
|
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> |
18 |
|
|
Acked-by: Russell King <rmk+kernel@armlinux.org.uk> |
19 |
|
|
Signed-off-by: David S. Miller <davem@davemloft.net> |
20 |
|
|
Signed-off-by: Sasha Levin <sashal@kernel.org> |
21 |
|
|
--- |
22 |
|
|
drivers/net/phy/phylink.c | 3 +++ |
23 |
|
|
1 file changed, 3 insertions(+) |
24 |
|
|
|
25 |
|
|
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c |
26 |
|
|
index 7abca86c3aa9..70f3f90c2ed6 100644 |
27 |
|
|
--- a/drivers/net/phy/phylink.c |
28 |
|
|
+++ b/drivers/net/phy/phylink.c |
29 |
|
|
@@ -907,6 +907,9 @@ void phylink_start(struct phylink *pl) |
30 |
|
|
phylink_an_mode_str(pl->link_an_mode), |
31 |
|
|
phy_modes(pl->link_config.interface)); |
32 |
|
|
|
33 |
|
|
+ /* Always set the carrier off */ |
34 |
|
|
+ netif_carrier_off(pl->netdev); |
35 |
|
|
+ |
36 |
|
|
/* Apply the link configuration to the MAC when starting. This allows |
37 |
|
|
* a fixed-link to start with the correct parameters, and also |
38 |
|
|
* ensures that we set the appropriate advertisement for Serdes links. |
39 |
|
|
-- |
40 |
|
|
2.19.1 |
41 |
|
|
|