PATCH: fix ISA/PCI interrupt allocation
David Hinds
dhinds at sonic.net
Fri Dec 12 09:10:40 GMT 2003
This is a forward port of a patch for 2.4. I'd appreciate if someone
could test with 2.6 since I can't. This changes interrupt allocation
for 16-bit cards so that if ISA interrupts are all in use, the
bridge's PCI interrupt will be used.
-- Dave
--- clean/linux-2.6.0-test11/drivers/pcmcia/cs.c Wed Nov 26 12:43:26 2003
+++ linux-2.6.0-test11/drivers/pcmcia/cs.c Sat Dec 6 23:30:17 2003
@@ -1916,7 +1916,7 @@
{
struct pcmcia_socket *s;
config_t *c;
- int ret = 0, irq = 0;
+ int ret = CS_IN_USE, irq = 0;
if (CHECK_HANDLE(handle))
return CS_BAD_HANDLE;
@@ -1928,13 +1928,9 @@
return CS_CONFIGURATION_LOCKED;
if (c->state & CONFIG_IRQ_REQ)
return CS_IN_USE;
-
- /* Short cut: if there are no ISA interrupts, then it is PCI */
- if (!s->irq_mask) {
- irq = s->pci_irq;
- ret = (irq) ? 0 : CS_IN_USE;
+
#ifdef CONFIG_PCMCIA_PROBE
- } else if (s->irq.AssignedIRQ != 0) {
+ if (s->irq.AssignedIRQ != 0) {
/* If the interrupt is already assigned, it must match */
irq = s->irq.AssignedIRQ;
if (req->IRQInfo1 & IRQ_INFO2_VALID) {
@@ -1943,7 +1939,6 @@
} else
ret = ((req->IRQInfo1&IRQ_MASK) == irq) ? 0 : CS_BAD_ARGS;
} else {
- ret = CS_IN_USE;
if (req->IRQInfo1 & IRQ_INFO2_VALID) {
u_int try, mask = req->IRQInfo2 & s->irq_mask;
for (try = 0; try < 2; try++) {
@@ -1958,12 +1953,13 @@
irq = req->IRQInfo1 & IRQ_MASK;
ret = try_irq(req->Attributes, irq, 1);
}
-#else
- } else {
- ret = CS_UNSUPPORTED_MODE;
+ }
#endif
+ if (ret != 0) {
+ if (!s->pci_irq)
+ return ret;
+ irq = s->pci_irq;
}
- if (ret != 0) return ret;
if (req->Attributes & IRQ_HANDLE_PRESENT) {
if (request_irq(irq, req->Handler,
More information about the linux-pcmcia
mailing list