Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261956AbTKYDIa (ORCPT ); Mon, 24 Nov 2003 22:08:30 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261957AbTKYDIa (ORCPT ); Mon, 24 Nov 2003 22:08:30 -0500 Received: from x35.xmailserver.org ([69.30.125.51]:12937 "EHLO x35.xmailserver.org") by vger.kernel.org with ESMTP id S261956AbTKYDI1 (ORCPT ); Mon, 24 Nov 2003 22:08:27 -0500 X-AuthUser: davidel@xmailserver.org Date: Mon, 24 Nov 2003 19:08:26 -0800 (PST) From: Davide Libenzi X-X-Sender: davide@bigblue.dev.mdolabs.com To: Linus Torvalds cc: jt@hpl.hp.com, David Hinds , , Linux kernel mailing list Subject: Re: [BUG] Ricoh Cardbus -> Can't get interrupts In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2472 Lines: 84 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++; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/