aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorShaohui Xie <Shaohui.Xie@nxp.com>2016-05-10 05:42:26 -0400
committerDavid S. Miller <davem@davemloft.net>2016-05-10 15:59:49 -0400
commit84a527a41f38a80353f185d05e41b021e1ff672b (patch)
tree5ef4c6cf2bbb382b10276f8344453a03b2ebfaa7 /drivers/net/phy
parent10a81980fc47e64ffac26a073139813d3f697b64 (diff)
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>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/phy.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 5590b9c182c9..445fc5aef308 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -790,9 +790,11 @@ void phy_start(struct phy_device *phydev)
790 break; 790 break;
791 case PHY_HALTED: 791 case PHY_HALTED:
792 /* make sure interrupts are re-enabled for the PHY */ 792 /* make sure interrupts are re-enabled for the PHY */
793 err = phy_enable_interrupts(phydev); 793 if (phydev->irq != PHY_POLL) {
794 if (err < 0) 794 err = phy_enable_interrupts(phydev);
795 break; 795 if (err < 0)
796 break;
797 }
796 798
797 phydev->state = PHY_RESUMING; 799 phydev->state = PHY_RESUMING;
798 do_resume = true; 800 do_resume = true;