Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 289834
b: refs/heads/master
c: 6c4a70c
h: refs/heads/master
v: v3
  • Loading branch information
Francois Romieu committed Jan 31, 2012
1 parent f5e11f0 commit a8414dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 98ddf986fca17840e46e070354b7e2cd2169da15
refs/heads/master: 6c4a70c5f286077e78b294b3f3a93dc45c40db89
13 changes: 7 additions & 6 deletions trunk/drivers/net/ethernet/realtek/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ struct rtl8169_counters {
};

enum rtl_flag {
RTL_FLAG_TASK_ENABLED,
RTL_FLAG_TASK_SLOW_PENDING,
RTL_FLAG_TASK_RESET_PENDING,
RTL_FLAG_TASK_PHY_PENDING,
Expand Down Expand Up @@ -725,7 +726,6 @@ struct rtl8169_private {
DECLARE_BITMAP(flags, RTL_FLAG_MAX);
struct mutex mutex;
struct work_struct work;
bool enabled;
} wk;

unsigned features;
Expand Down Expand Up @@ -4352,7 +4352,7 @@ static int rtl8169_open(struct net_device *dev)

rtl_lock_work(tp);

tp->wk.enabled = true;
set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);

napi_enable(&tp->napi);

Expand Down Expand Up @@ -5879,7 +5879,8 @@ static void rtl_task(struct work_struct *work)

rtl_lock_work(tp);

if (!netif_running(dev) || !tp->wk.enabled)
if (!netif_running(dev) ||
!test_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags))
goto out_unlock;

for (i = 0; i < ARRAY_SIZE(rtl_work); i++) {
Expand Down Expand Up @@ -5977,7 +5978,7 @@ static int rtl8169_close(struct net_device *dev)
rtl8169_update_counters(dev);

rtl_lock_work(tp);
tp->wk.enabled = false;
clear_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);

rtl8169_down(dev);
rtl_unlock_work(tp);
Expand Down Expand Up @@ -6076,7 +6077,7 @@ static void rtl8169_net_suspend(struct net_device *dev)

rtl_lock_work(tp);
napi_disable(&tp->napi);
tp->wk.enabled = false;
clear_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);
rtl_unlock_work(tp);

rtl_pll_power_down(tp);
Expand All @@ -6102,7 +6103,7 @@ static void __rtl8169_resume(struct net_device *dev)

rtl_pll_power_up(tp);

tp->wk.enabled = true;
set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);

rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING);
}
Expand Down

0 comments on commit a8414dd

Please sign in to comment.