• Heiner Kallweit's avatar
    net: phy: warn if phy_start is called from invalid state · 21796261
    Heiner Kallweit authored
    phy_start() should be called from states PHY_READY or PHY_HALTED only.
    Check for this to detect misbehaving drivers. Also the state machine
    should be started only when being called from one of the valid states.
    
    Some more background:
    For all invalid states phy_start() basically was a no-op. All it did
    was triggering a state machine run, but for all "running" states the
    poll loop was active anyway. And if called from PHY_DOWN, the state
    machine does nothing.
    
    v3:
    - extended commit message
    Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    21796261
phy.c 32.1 KB