projects
/
linux-2.6-block.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net: phy: fix PHY_RUNNING in phy_state_machine
[linux-2.6-block.git]
/
drivers
/
net
/
phy
/
phy.c
diff --git
a/drivers/net/phy/phy.c
b/drivers/net/phy/phy.c
index b2197b506acbe86f3540d5ae1d8334129c2bbe57..1e1fbb049ec63b79c1d8255c517364f739a8d38b 100644
(file)
--- a/
drivers/net/phy/phy.c
+++ b/
drivers/net/phy/phy.c
@@
-811,6
+811,7
@@
void phy_state_machine(struct work_struct *work)
bool needs_aneg = false, do_suspend = false;
enum phy_state old_state;
int err = 0;
bool needs_aneg = false, do_suspend = false;
enum phy_state old_state;
int err = 0;
+ int old_link;
mutex_lock(&phydev->lock);
mutex_lock(&phydev->lock);
@@
-896,11
+897,18
@@
void phy_state_machine(struct work_struct *work)
phydev->adjust_link(phydev->attached_dev);
break;
case PHY_RUNNING:
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);
break;
case PHY_CHANGELINK:
err = phy_read_status(phydev);