From 2084b114e3fb0d84e5882f5ee6c7039be52da715 Mon Sep 17 00:00:00 2001 From: Flavio Leitner Date: Tue, 5 Apr 2011 04:27:43 +0000 Subject: [PATCH] e1000e: fix stats locking in e1000_watchdog_task Just move the unlock down a bit because it unlocks too early leaving a chance for get_stats64() run in parallel while it is still accessing the stats. Signed-off-by: Flavio Leitner Acked-by: Bruce Allan Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher --- drivers/net/e1000e/netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 8812eb28e09..8a3145e9aa3 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c @@ -4339,7 +4339,6 @@ static void e1000_watchdog_task(struct work_struct *work) link_up: spin_lock(&adapter->stats64_lock); e1000e_update_stats(adapter); - spin_unlock(&adapter->stats64_lock); mac->tx_packet_delta = adapter->stats.tpt - adapter->tpt_old; adapter->tpt_old = adapter->stats.tpt; @@ -4350,6 +4349,7 @@ link_up: adapter->gorc_old = adapter->stats.gorc; adapter->gotc = adapter->stats.gotc - adapter->gotc_old; adapter->gotc_old = adapter->stats.gotc; + spin_unlock(&adapter->stats64_lock); e1000e_update_adaptive(&adapter->hw); -- 2.11.4.GIT