1 From 6f3ea4e5b1f0867ec217f6101fcb89783ed905d7 Mon Sep 17 00:00:00 2001
2 From: Russell King <rmk+kernel@armlinux.org.uk>
3 Date: Sat, 9 Feb 2019 18:23:26 +0000
4 Subject: [PATCH] net: phylink: only call mac_config() during resolve
7 There's little point calling mac_config() when the link is down.
9 Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
11 drivers/net/phy/phylink.c | 11 +++++++++--
12 1 file changed, 9 insertions(+), 2 deletions(-)
14 --- a/drivers/net/phy/phylink.c
15 +++ b/drivers/net/phy/phylink.c
16 @@ -339,6 +339,13 @@ static void phylink_mac_config(struct ph
17 pl->ops->mac_config(pl->netdev, pl->link_an_mode, state);
20 +static void phylink_mac_config_up(struct phylink *pl,
21 + const struct phylink_link_state *state)
24 + phylink_mac_config(pl, state);
27 static void phylink_mac_an_restart(struct phylink *pl)
29 if (pl->link_config.an_enabled &&
30 @@ -442,12 +449,12 @@ static void phylink_resolve(struct work_
32 link_state = pl->phy_state;
33 phylink_resolve_flow(pl, &link_state);
34 - phylink_mac_config(pl, &link_state);
35 + phylink_mac_config_up(pl, &link_state);
39 phylink_get_fixed_state(pl, &link_state);
40 - phylink_mac_config(pl, &link_state);
41 + phylink_mac_config_up(pl, &link_state);