diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2020-01-28 12:42:19 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2020-04-16 23:03:57 +0100 |
commit | 4858ea1731d621dfa9615b7ea9102c7924f1fa29 (patch) | |
tree | 658aae79f5bfdd4048d117771ddf5d979151023e /drivers | |
parent | 8d55917dbd758d16470816a1fc187b4aefa87d32 (diff) |
net: phylink: rejig resolve retriggering
Use a boolean flag in phylink_resolve() to indicate whether we should
re-run the resolve after the current one has completed. This will allow
us to retrigger the resolution for other conditions in future.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/phy/phylink.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 6033d2dfd223..169d05f0fd8e 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -572,6 +572,7 @@ static void phylink_resolve(struct work_struct *w) struct phylink_link_state link_state; struct net_device *ndev = pl->netdev; bool cur_link_state; + bool retrigger = false; mutex_lock(&pl->state_mutex); if (pl->netdev) @@ -583,7 +584,9 @@ static void phylink_resolve(struct work_struct *w) pl->mac_link_dropped = false; link_state.link = false; } else if (pl->mac_link_dropped) { + pl->mac_link_dropped = false; link_state.link = false; + retrigger = true; } else { switch (pl->cur_link_an_mode) { case MLO_AN_PHY: @@ -628,10 +631,8 @@ static void phylink_resolve(struct work_struct *w) else phylink_link_up(pl, link_state); } - if (!link_state.link && pl->mac_link_dropped) { - pl->mac_link_dropped = false; + if (retrigger) queue_work(system_power_efficient_wq, &pl->resolve); - } mutex_unlock(&pl->state_mutex); } |