netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Thalmeier <Michael.Thalmeier@sigmatek.at>
To: Florian Fainelli <florian@openwrt.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	michael@thalmeier.at,
	Michael Thalmeier <Michael.Thalmeier@sigmatek.at>
Subject: [PATCH 1/1] r6040: only disable RX interrupt if napi_schedule_prep is successful
Date: Fri, 15 Jul 2011 13:28:26 +0200	[thread overview]
Message-ID: <1310729306-12190-1-git-send-email-Michael.Thalmeier@sigmatek.at> (raw)

When receiving the first RX interrupt before the internal call
to napi_schedule_prep is successful the RX interrupt gets disabled
and is never enabled again as the poll function never gets executed.

Signed-off-by: Michael Thalmeier <Michael.Thalmeier@sigmatek.at>
---
 drivers/net/r6040.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index 200a363..0ffec46 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -677,9 +677,11 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
 		if (status & RX_FIFO_FULL)
 			dev->stats.rx_fifo_errors++;
 
-		/* Mask off RX interrupt */
-		misr &= ~RX_INTS;
-		napi_schedule(&lp->napi);
+		if (likely(napi_schedule_prep(&lp->napi))) {
+			/* Mask off RX interrupt */
+			misr &= ~RX_INTS;
+			__napi_schedule(&lp->napi);
+		}
 	}
 
 	/* TX interrupt request */
-- 
1.7.1


             reply	other threads:[~2011-07-15 11:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-15 11:28 Michael Thalmeier [this message]
2011-07-15 15:10 ` [PATCH 1/1] r6040: only disable RX interrupt if napi_schedule_prep is successful David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1310729306-12190-1-git-send-email-Michael.Thalmeier@sigmatek.at \
    --to=michael.thalmeier@sigmatek.at \
    --cc=florian@openwrt.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@thalmeier.at \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).