• Heiner Kallweit's avatar
    net: core: try to runtime-resume detached device in __dev_open · bd869245
    Heiner Kallweit authored
    A netdevice may be marked as detached because the parent is
    runtime-suspended and not accessible whilst interface or link is down.
    An example are PCI network devices that go into PCI D3hot, see e.g.
    __igc_shutdown() or rtl8169_net_suspend().
    If netdevice is down and marked as detached we can only open it if
    we runtime-resume it before __dev_open() calls netif_device_present().
    
    Therefore, if netdevice is detached, try to runtime-resume the parent
    and only return with an error if it's still detached.
    Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    bd869245
dev.c 266 KB