• Russell King's avatar
    net: phy: fix resume handling · f5e64032
    Russell King authored
    When a PHY has the BMCR_PDOWN bit set, it may decide to ignore writes
    to other registers, or reset the registers to power-on defaults.
    Micrel PHYs do this for their interrupt registers.
    
    The current structure of phylib tries to enable interrupts before
    resuming (and releasing) the BMCR_PDOWN bit.  This fails, causing
    Micrel PHYs to stop working after a suspend/resume sequence if they
    are using interrupts.
    
    Fix this by ensuring that the PHY driver resume methods do not take
    the phydev->lock mutex themselves, but the callers of phy_resume()
    take that lock.  This then allows us to move the call to phy_resume()
    before we enable interrupts in phy_start().
    Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
    Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    f5e64032
phy_device.c 48.3 KB