aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFigo.zhang <zhangtianfei@leadcoretech.com>2010-06-07 21:13:22 +0000
committerDavid S. Miller <davem@davemloft.net>2010-06-10 23:14:08 -0700
commit349124a00754129a5f1e43efa84733e364bf3749 (patch)
treeacff33465eb6b21aadca78657a7fa330d6987936
parent07a0f0f07a68014c92c752a5598102372bddf46e (diff)
downloadkernel_samsung_tuna-349124a00754129a5f1e43efa84733e364bf3749.zip
kernel_samsung_tuna-349124a00754129a5f1e43efa84733e364bf3749.tar.gz
kernel_samsung_tuna-349124a00754129a5f1e43efa84733e364bf3749.tar.bz2
net8139: fix a race at the end of NAPI
fix a race at the end of NAPI complete processing, it had better do __napi_complete() first before re-enable interrupt. Signed-off-by:Figo.zhang <figo1802@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/8139cp.c2
-rw-r--r--drivers/net/8139too.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index 9c14975..284a5f4 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -598,8 +598,8 @@ rx_next:
goto rx_status_loop;
spin_lock_irqsave(&cp->lock, flags);
- cpw16_f(IntrMask, cp_intr_mask);
__napi_complete(napi);
+ cpw16_f(IntrMask, cp_intr_mask);
spin_unlock_irqrestore(&cp->lock, flags);
}
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index 80cd074..97d8068 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -2089,8 +2089,8 @@ static int rtl8139_poll(struct napi_struct *napi, int budget)
* again when we think we are done.
*/
spin_lock_irqsave(&tp->lock, flags);
- RTL_W16_F(IntrMask, rtl8139_intr_mask);
__napi_complete(napi);
+ RTL_W16_F(IntrMask, rtl8139_intr_mask);
spin_unlock_irqrestore(&tp->lock, flags);
}
spin_unlock(&tp->rx_lock);