netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Jeff Garzik <jgarzik@pobox.com>, Paul Gortmaker <p_gortmaker@yahoo.com>
Cc: netdev@oss.sgi.com
Subject: [PATCH 2.6.1] Allow pcnet_cs to work with shared irq
Date: Tue, 20 Jan 2004 16:22:51 -0800	[thread overview]
Message-ID: <20040120162251.291a0e39.shemminger@osdl.org> (raw)

On some laptops, the pcmcia card shares an irq with other things
like the serial or irda ports.  The pcnet_cs driver did not correctly
handle shared interrupts, this fixes it for me.

ei_interrupt now returns IRQ_HANDLED if some frames have been serviced,
and the wrapper routine propagates the error code.

diff -Nru a/drivers/net/8390.c b/drivers/net/8390.c
--- a/drivers/net/8390.c	Tue Jan 20 16:21:00 2004
+++ b/drivers/net/8390.c	Tue Jan 20 16:21:00 2004
@@ -520,7 +520,7 @@
 		}
 	}
 	spin_unlock(&ei_local->page_lock);
-	return IRQ_HANDLED;
+	return IRQ_RETVAL(nr_serviced > 0);
 }
 
 /**
diff -Nru a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
--- a/drivers/net/pcmcia/pcnet_cs.c	Tue Jan 20 16:21:00 2004
+++ b/drivers/net/pcmcia/pcnet_cs.c	Tue Jan 20 16:21:00 2004
@@ -1193,10 +1193,11 @@
 static irqreturn_t ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs)
 {
     pcnet_dev_t *info = dev_id;
-    info->stale = 0;
-    ei_interrupt(irq, dev_id, regs);
-    /* FIXME! Was it really ours? */
-    return IRQ_HANDLED;
+    irqreturn_t ret = ei_interrupt(irq, dev_id, regs);
+
+    if (ret == IRQ_HANDLED)
+	    info->stale = 0;
+    return ret;
 }
 
 static void ei_watchdog(u_long arg)

             reply	other threads:[~2004-01-21  0:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-21  0:22 Stephen Hemminger [this message]
2004-02-19  0:40 ` [PATCH 2.6.1] Allow pcnet_cs to work with shared irq Jeff Garzik
2004-02-19 18:30   ` Stephen Hemminger
2004-02-25  1:01     ` Jeff Garzik

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=20040120162251.291a0e39.shemminger@osdl.org \
    --to=shemminger@osdl.org \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.com \
    --cc=p_gortmaker@yahoo.com \
    /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).