From: Andrew Lunn Date: Mon, 16 Nov 2015 22:36:46 +0000 (+0100) Subject: net: phy: Use interrupts when available in NOLINK state X-Git-Tag: v5.15~14678^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=321beec5047af83db90c88114b7e664b156f49fe;p=platform%2Fkernel%2Flinux-starfive.git net: phy: Use interrupts when available in NOLINK state The NOLINK state will poll the phy once a second to see if the link has come up. If the phy has an interrupt line, this polling can be skipped, since the phy should interrupt when the link returns. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller --- diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index adb48ab..48ce6ef 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -863,6 +863,9 @@ void phy_state_machine(struct work_struct *work) needs_aneg = true; break; case PHY_NOLINK: + if (phy_interrupt_is_valid(phydev)) + break; + err = phy_read_status(phydev); if (err) break;