Commit 129c6cda authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

8139too: revisit napi_complete_done() usage

It seems we have to be more careful in napi_complete_done()
use. This patch is not a revert, as it seems we can
avoid bug that Ville reported by moving the napi_complete_done()
test in the spinlock section.

Many thanks to Ville for detective work and all tests.

Fixes: 617f0121 ("8139too: use napi_complete_done()")
Reported-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4c712441
......@@ -2135,10 +2135,11 @@ static int rtl8139_poll(struct napi_struct *napi, int budget)
if (likely(RTL_R16(IntrStatus) & RxAckBits))
work_done += rtl8139_rx(dev, tp, budget);
if (work_done < budget && napi_complete_done(napi, work_done)) {
if (work_done < budget) {
unsigned long flags;
spin_lock_irqsave(&tp->lock, flags);
if (napi_complete_done(napi, work_done))
RTL_W16_F(IntrMask, rtl8139_intr_mask);
spin_unlock_irqrestore(&tp->lock, flags);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment