• Kai-Heng Feng's avatar
    r8169: Clear RTL_FLAG_TASK_*_PENDING when clearing RTL_FLAG_TASK_ENABLED · 6ad56901
    Kai-Heng Feng authored
    After system suspend, sometimes the r8169 doesn't work when ethernet
    cable gets pluggued.
    
    This issue happens because rtl_reset_work() doesn't get called from
    rtl8169_runtime_resume(), after system suspend.
    
    In rtl_task(), RTL_FLAG_TASK_* only gets cleared if this condition is
    met:
    if (!netif_running(dev) ||
        !test_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags))
        ...
    
    If RTL_FLAG_TASK_ENABLED was cleared during system suspend while
    RTL_FLAG_TASK_RESET_PENDING was set, the next rtl_schedule_task() won't
    schedule task as the flag is still there.
    
    So in addition to clearing RTL_FLAG_TASK_ENABLED, also clears other
    flags.
    
    Cc: Heiner Kallweit <hkallweit1@gmail.com>
    Signed-off-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    6ad56901
r8169.c 184 KB