linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Davide Libenzi <davidel@xmailserver.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: jt@hpl.hp.com, David Hinds <dhinds@sonic.net>,
	<linux-pcmcia@lists.infradead.org>,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] Ricoh Cardbus -> Can't get interrupts
Date: Mon, 24 Nov 2003 19:08:26 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0311241906500.1986-100000@bigblue.dev.mdolabs.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0311241845200.1599@home.osdl.org>

On Mon, 24 Nov 2003, Linus Torvalds wrote:

> 
> On Mon, 24 Nov 2003, Jean Tourrilhes wrote:
> >
> > 	Currently, I managed to narrow down to :
> > -------------------------------------------------
> > PCI: Using IRQ router PIIX [8086/7110] at 0000:00:07.0
> 
> Can you do a "dump_pirq"? (Found on http://www.kernelnewbies.org/scripts/
> among other places, maybe there are newer versions, David would know).

I didn't want to post this because I was ashamed of the fix, but w/out 
this my orinoco cardbus gets an interrupt one every ten boots. This is 
against 2.4.20 ...



- Davide



diff -Nru linux-2.4.20-8ref/drivers/pcmcia/cs.c linux-2.4.20-8custom/drivers/pcmcia/cs.c
--- linux-2.4.20-8ref/drivers/pcmcia/cs.c	2003-05-27 21:30:12.527683232 -0700
+++ linux-2.4.20-8custom/drivers/pcmcia/cs.c	2003-05-27 19:59:55.000000000 -0700
@@ -1859,6 +1859,7 @@
     socket_info_t *s;
     config_t *c;
     int ret = 0, irq = 0;
+    u_int attr;
     
     if (CHECK_HANDLE(handle))
 	return CS_BAD_HANDLE;
@@ -1902,18 +1903,36 @@
 	}
 #endif
     }
-    if (ret != 0) return ret;
+    if (ret != 0) {
+        if (!s->cap.pci_irq)
+	    return ret;
+	irq = s->cap.pci_irq;
+    }
 
+    attr = req->Attributes;
     if (req->Attributes & IRQ_HANDLE_PRESENT) {
+        int share_irq;
+
+        share_irq = (attr & IRQ_TYPE_DYNAMIC_SHARING) ||
+            (s->functions > 1) ||
+            (irq == s->cap.pci_irq);
+    retry:
 	if (bus_request_irq(s->cap.bus, irq, req->Handler,
-			    ((req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) || 
-			     (s->functions > 1) ||
-			     (irq == s->cap.pci_irq)) ? SA_SHIRQ : 0,
-			    handle->dev_info, req->Instance))
-	    return CS_IN_USE;
+                            share_irq ? SA_SHIRQ : 0,
+                            handle->dev_info, req->Instance)) {
+            if (!share_irq) {
+               share_irq = 1;
+               goto retry;
+            }
+            return CS_IN_USE;
+	}
+        if (share_irq) {
+            attr &= ~IRQ_TYPE_EXCLUSIVE;
+            attr |= IRQ_TYPE_DYNAMIC_SHARING;
+	}
     }
-
-    c->irq.Attributes = req->Attributes;
+  
+    c->irq.Attributes = attr;
     s->irq.AssignedIRQ = req->AssignedIRQ = irq;
     s->irq.Config++;
     


  parent reply	other threads:[~2003-11-25  3:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-24 23:57 [BUG] Ricoh Cardbus -> Can't get interrupts Jean Tourrilhes
2003-11-25  0:16 ` glee
2003-11-25  0:37   ` Jean Tourrilhes
2003-11-25  0:26 ` David Hinds
2003-11-25  0:49   ` Jean Tourrilhes
2003-11-25  2:06     ` Linus Torvalds
2003-11-25  2:33       ` Jean Tourrilhes
2003-11-25  2:49         ` Linus Torvalds
2003-11-25  2:52           ` Linus Torvalds
2003-11-25  3:11             ` Jean Tourrilhes
2003-11-25  3:25               ` Linus Torvalds
     [not found]                 ` <20031125034815.GC4483@bougret.hpl.hp.com>
     [not found]                   ` <Pine.LNX.4.58.0311242028220.1599@home.osdl.org>
     [not found]                     ` <Pine.LNX.4.58.0311242100540.1599@home.osdl.org>
2003-11-26  1:54                       ` Jean Tourrilhes
2003-11-25  3:08           ` Davide Libenzi [this message]
2003-11-26  1:59             ` Jean Tourrilhes
2003-11-26  2:17               ` Davide Libenzi
2003-11-27 18:56             ` David Hinds
2003-11-27 20:15               ` Davide Libenzi
2003-11-25  2:03 ` Linus Torvalds
2003-11-25  2:24   ` Linus Torvalds
2003-11-25  2:56     ` Jean Tourrilhes
2003-11-25  3:03       ` Linus Torvalds
2003-11-25  3:38         ` Jean Tourrilhes
2003-11-25 10:41       ` Jes Sorensen

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=Pine.LNX.4.44.0311241906500.1986-100000@bigblue.dev.mdolabs.com \
    --to=davidel@xmailserver.org \
    --cc=dhinds@sonic.net \
    --cc=jt@hpl.hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pcmcia@lists.infradead.org \
    --cc=torvalds@osdl.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).