Commit 67285f85 authored by Shaohui Xie's avatar Shaohui Xie Committed by Khalid Elmously

net: phylib: fix interrupts re-enablement in phy_start

BugLink: https://bugs.launchpad.net/bugs/1785739

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: default avatarShaohui Xie <Shaohui.Xie@nxp.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
(cherry picked from commit 84a527a4)
Signed-off-by: default avatardann frazier <dann.frazier@canonical.com>
Acked-by: default avatarKleber Souza <kleber.souza@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent bfa2e6ed
...@@ -793,9 +793,11 @@ void phy_start(struct phy_device *phydev) ...@@ -793,9 +793,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 (phydev->irq != PHY_POLL) {
if (err < 0) err = phy_enable_interrupts(phydev);
break; if (err < 0)
break;
}
phydev->state = PHY_RESUMING; phydev->state = PHY_RESUMING;
do_resume = true; do_resume = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment