Skip to content

Commit 349124a

Browse files
Figo.zhangdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 07a0f0f commit 349124a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/net/8139cp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,8 @@ static int cp_rx_poll(struct napi_struct *napi, int budget)
598598
goto rx_status_loop;
599599

600600
spin_lock_irqsave(&cp->lock, flags);
601-
cpw16_f(IntrMask, cp_intr_mask);
602601
__napi_complete(napi);
602+
cpw16_f(IntrMask, cp_intr_mask);
603603
spin_unlock_irqrestore(&cp->lock, flags);
604604
}
605605

drivers/net/8139too.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2089,8 +2089,8 @@ static int rtl8139_poll(struct napi_struct *napi, int budget)
20892089
* again when we think we are done.
20902090
*/
20912091
spin_lock_irqsave(&tp->lock, flags);
2092-
RTL_W16_F(IntrMask, rtl8139_intr_mask);
20932092
__napi_complete(napi);
2093+
RTL_W16_F(IntrMask, rtl8139_intr_mask);
20942094
spin_unlock_irqrestore(&tp->lock, flags);
20952095
}
20962096
spin_unlock(&tp->rx_lock);

0 commit comments

Comments
 (0)