mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-27 17:18:59 +00:00
92b8fe0e0e
Refreshed all patches. Compile-tested on: imx6 Runtime-tested on: imx6 Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
45 lines
1.3 KiB
Diff
45 lines
1.3 KiB
Diff
From 6f3ea4e5b1f0867ec217f6101fcb89783ed905d7 Mon Sep 17 00:00:00 2001
|
|
From: Russell King <rmk+kernel@armlinux.org.uk>
|
|
Date: Sat, 9 Feb 2019 18:23:26 +0000
|
|
Subject: [PATCH] net: phylink: only call mac_config() during resolve
|
|
when link is up
|
|
|
|
There's little point calling mac_config() when the link is down.
|
|
|
|
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
|
---
|
|
drivers/net/phy/phylink.c | 11 +++++++++--
|
|
1 file changed, 9 insertions(+), 2 deletions(-)
|
|
|
|
--- a/drivers/net/phy/phylink.c
|
|
+++ b/drivers/net/phy/phylink.c
|
|
@@ -337,6 +337,13 @@ static void phylink_mac_config(struct ph
|
|
pl->ops->mac_config(pl->netdev, pl->link_an_mode, state);
|
|
}
|
|
|
|
+static void phylink_mac_config_up(struct phylink *pl,
|
|
+ const struct phylink_link_state *state)
|
|
+{
|
|
+ if (state->link)
|
|
+ phylink_mac_config(pl, state);
|
|
+}
|
|
+
|
|
static void phylink_mac_an_restart(struct phylink *pl)
|
|
{
|
|
if (pl->link_config.an_enabled &&
|
|
@@ -440,12 +447,12 @@ static void phylink_resolve(struct work_
|
|
case MLO_AN_PHY:
|
|
link_state = pl->phy_state;
|
|
phylink_resolve_flow(pl, &link_state);
|
|
- phylink_mac_config(pl, &link_state);
|
|
+ phylink_mac_config_up(pl, &link_state);
|
|
break;
|
|
|
|
case MLO_AN_FIXED:
|
|
phylink_get_fixed_state(pl, &link_state);
|
|
- phylink_mac_config(pl, &link_state);
|
|
+ phylink_mac_config_up(pl, &link_state);
|
|
break;
|
|
|
|
case MLO_AN_INBAND:
|