diff options
author | David S. Miller <davem@davemloft.net> | 2015-08-21 11:44:04 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-08-21 11:44:04 -0700 |
commit | dc25b25897289bad4907f30151ffe5baf75ff369 (patch) | |
tree | c99301de2cdf66d7af48fc43b6161bda6faaae70 /drivers/net/phy/phy.c | |
parent | 1a69205c471221a7f9101df164642611e37c52e4 (diff) | |
parent | 0bad90985d39e69ca035fdd70bcc743812641d18 (diff) | |
download | linux-dc25b25897289bad4907f30151ffe5baf75ff369.tar.bz2 |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/usb/qmi_wwan.c
Overlapping additions of new device IDs to qmi_wwan.c
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r-- | drivers/net/phy/phy.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 84b1fba58ac3..d9728516dac3 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -814,6 +814,7 @@ void phy_state_machine(struct work_struct *work) bool needs_aneg = false, do_suspend = false; enum phy_state old_state; int err = 0; + int old_link; mutex_lock(&phydev->lock); @@ -899,11 +900,18 @@ void phy_state_machine(struct work_struct *work) phydev->adjust_link(phydev->attached_dev); break; case PHY_RUNNING: - /* Only register a CHANGE if we are - * polling or ignoring interrupts + /* Only register a CHANGE if we are polling or ignoring + * interrupts and link changed since latest checking. */ - if (!phy_interrupt_is_valid(phydev)) - phydev->state = PHY_CHANGELINK; + if (!phy_interrupt_is_valid(phydev)) { + old_link = phydev->link; + err = phy_read_status(phydev); + if (err) + break; + + if (old_link != phydev->link) + phydev->state = PHY_CHANGELINK; + } break; case PHY_CHANGELINK: err = phy_read_status(phydev); |