Netdev List
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@mvista.com>
To: netdev@vger.kernel.org
Cc: Nicolas Pitre <nico@cam.org>, Kevin Hilman <khilman@mvista.com>
Subject: [PATCH] SMC91x: poll_controller(): check for interrupts before calling handler
Date: Thu, 24 Jan 2008 21:38:23 -0800	[thread overview]
Message-ID: <1201239503-16407-1-git-send-email-khilman@mvista.com> (raw)

When using polling, smc_poll_controller() can call smc_interrupt()
when there are likely to be no real interrups.  This will trigger the
"spurious interrupt" printk whenever the driver is being polled.

Instead, check for actual interrupts before calling smc_interrupt()

Signed-off-by: Kevin Hilman <khilman@mvista.com>
Signed-off-by: Nicolas Pitre <nico@cam.org>
---
 drivers/net/smc91x.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index 7da7589..64ef6c1 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -1350,8 +1350,12 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id)
  */
 static void smc_poll_controller(struct net_device *dev)
 {
+	struct smc_local *lp = netdev_priv(dev);
+	void __iomem *ioaddr = lp->base;
+
 	disable_irq(dev->irq);
-	smc_interrupt(dev->irq, dev);
+	if (SMC_GET_INT() & SMC_GET_INT_MASK())
+		smc_interrupt(dev->irq, dev);
 	enable_irq(dev->irq);
 }
 #endif
-- 
1.5.3.7


                 reply	other threads:[~2008-01-25  5:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1201239503-16407-1-git-send-email-khilman@mvista.com \
    --to=khilman@mvista.com \
    --cc=netdev@vger.kernel.org \
    --cc=nico@cam.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