diff mbox

[3/8] ethoc: enable interrupts after napi_complete

Message ID 1290606058-26703-4-git-send-email-jonas@southpole.se
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Jonas Bonn Nov. 24, 2010, 1:40 p.m. UTC
From: Adam Edvardsson <adam.edvardsson@orsoc.se>

Occasionally, it seems that some race is causing the interrupts to not be
reenabled otherwise with the end result that networking just stops working.
Enabling interrupts after calling napi_complete is more in line with what
other drivers do.

Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
 drivers/net/ethoc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

laurent chavey Nov. 24, 2010, 6:45 p.m. UTC | #1
ethoc_rx can return a value == budget
if work_done == budget, interrupt
are not re-enabled

in net_rx_action, the check for budget <= 0 will
cause the poll loop to not be called, but will removed
the callback to be removed from the poll_list.

could this result in interrupt not being re-enabled ?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
laurent chavey Nov. 24, 2010, 7:33 p.m. UTC | #2
actually my previous comments are not correct.
the check for work_done < budget will
only cause an extra call with work_done == 0
if no more work is done.
so that will work.

--
--------------------------------------------------------------------------------
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index fc8c044..53c03f2 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -569,8 +569,8 @@  static int ethoc_poll(struct napi_struct *napi, int budget)
 
 	work_done = ethoc_rx(priv->netdev, budget);
 	if (work_done < budget) {
-		ethoc_enable_irq(priv, INT_MASK_RX);
 		napi_complete(napi);
+		ethoc_enable_irq(priv, INT_MASK_RX);
 	}
 
 	return work_done;