浏览代码

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 <Shaohui.Xie@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Shaohui Xie 9 年之前
父节点
当前提交
84a527a41f
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      drivers/net/phy/phy.c

+ 5 - 3
drivers/net/phy/phy.c

@@ -790,9 +790,11 @@ void phy_start(struct phy_device *phydev)
 		break;
 		break;
 	case PHY_HALTED:
 	case PHY_HALTED:
 		/* make sure interrupts are re-enabled for the PHY */
 		/* 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;
 		phydev->state = PHY_RESUMING;
 		do_resume = true;
 		do_resume = true;