Skip to content

Commit 84a527a

Browse files
Shaohui Xiedavem330
authored andcommitted
net: phylib: fix interrupts re-enablement in phy_start
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]>
1 parent 10a8198 commit 84a527a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/net/phy/phy.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -790,9 +790,11 @@ void phy_start(struct phy_device *phydev)
790790
break;
791791
case PHY_HALTED:
792792
/* make sure interrupts are re-enabled for the PHY */
793-
err = phy_enable_interrupts(phydev);
794-
if (err < 0)
795-
break;
793+
if (phydev->irq != PHY_POLL) {
794+
err = phy_enable_interrupts(phydev);
795+
if (err < 0)
796+
break;
797+
}
796798

797799
phydev->state = PHY_RESUMING;
798800
do_resume = true;

0 commit comments

Comments
 (0)