Skip to content

Commit

Permalink
net: phylib: fix interrupts re-enablement in phy_start
Browse files Browse the repository at this point in the history
If phy was suspended and is starting, current driver always enable
phy's interrupts, if phy works in polling, phy can raise unexpected
interrupt which will not be handled, the interrupt will block system
enter suspend again. So interrupts should only be re-enabled if phy
works in interrupt.

Signed-off-by: Shaohui Xie <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Shaohui Xie authored and davem330 committed May 10, 2016
1 parent 10a8198 commit 84a527a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/net/phy/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,9 +790,11 @@ void phy_start(struct phy_device *phydev)
break;
case PHY_HALTED:
/* make sure interrupts are re-enabled for the PHY */
err = phy_enable_interrupts(phydev);
if (err < 0)
break;
if (phydev->irq != PHY_POLL) {
err = phy_enable_interrupts(phydev);
if (err < 0)
break;
}

phydev->state = PHY_RESUMING;
do_resume = true;
Expand Down

0 comments on commit 84a527a

Please sign in to comment.