Skip to content
  • Matt Carlson's avatar
    tg3: Only allow phy ioctls while netif_running · 34eea5ac
    Matt Carlson authored
    
    
    When tg3 was new, phy accesses through ioctl were allowable at any time.
    Then, the driver started shutting down the phy when the device was
    closed.  Phy accesses would be allowed when the driver first attached to
    the device, but then would be forbidden after the device had been up'd
    and down'd.  After that, management firmware made it illegal to access
    the phy unless the driver "owned" the device.  Now that most firmware
    is being moved over to the APE, it is less clear when phy accesses are
    safe.
    
    While it is possible to attempt to identify these conditions and code
    the driver to navigate through the pitfalls, it could be perplexing to
    the admin why phy accesses work in some cases and not others.  This
    patch brings some uniformity to the problem by only allowing phy
    accesses while the driver has control of the device.
    
    Signed-off-by: default avatarMatt Carlson <mcarlson@broadcom.com>
    Reviewed-by: default avatarMichael Chan <mchan@broadcom.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    34eea5ac