Commit 1fb55c83 authored by Dominik Brodowski's avatar Dominik Brodowski Committed by Linus Torvalds

[PATCH] pcmcia: ignore driver IRQ mask

As its just one pin which can be used for IRQs on PCMCIA/CardBus cards, and
only the _socket drivers_ care with which IRQ this pin is connected, only the
socket drivers (assisted by the PCCARD core) should care about which IRQ to
use.  Therefore, ignore the information passed to pcmcia_request_irq() in
IRQInfo2.  In additional patches, all in-kernel users of IRQInfo2 will be
removed; users wishing to influence the usage of IRQs can do so by modifying
several driver's irq_mask parameter and/or by adding "exclude irq 3" to
/etc/pcmcia/config.opts.  Note that a new sysfs-based interface to do so will
be added in subsequent patches.
Signed-off-by: default avatarDominik Brodowski <linux@brodo.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent cc9574ab
......@@ -1549,30 +1549,23 @@ int pcmcia_request_irq(client_handle_t handle, irq_req_t *req)
return CS_IN_USE;
#ifdef CONFIG_PCMCIA_PROBE
if (s->irq.AssignedIRQ != 0) {
/* If the interrupt is already assigned, it must match */
irq = s->irq.AssignedIRQ;
if (req->IRQInfo1 & IRQ_INFO2_VALID) {
u_int mask = req->IRQInfo2 & s->irq_mask;
ret = ((mask >> irq) & 1) ? 0 : CS_BAD_ARGS;
} else
ret = ((req->IRQInfo1&IRQ_MASK) == irq) ? 0 : CS_BAD_ARGS;
} else {
if (req->IRQInfo1 & IRQ_INFO2_VALID) {
u_int try, mask = req->IRQInfo2 & s->irq_mask;
for (try = 0; try < 2; try++) {
for (irq = 0; irq < 32; irq++)
if ((mask >> irq) & 1) {
ret = try_irq(req->Attributes, irq, try);
if (ret == 0) break;
}
if (ret == 0) break;
}
if (s->irq.AssignedIRQ != 0) {
/* If the interrupt is already assigned, it must be the same */
irq = s->irq.AssignedIRQ;
} else {
irq = req->IRQInfo1 & IRQ_MASK;
ret = try_irq(req->Attributes, irq, 1);
u_int try, mask = s->irq_mask;
for (try = 0; try < 2; try++) {
for (irq = 0; irq < 32; irq++) {
if ((mask >> irq) & 1) {
ret = try_irq(req->Attributes, irq, try);
if (!ret)
break;
}
}
if (!ret)
break;
}
}
}
#endif
if (ret != 0) {
if (!s->pci_irq)
......
......@@ -191,7 +191,7 @@ typedef struct io_req_t {
typedef struct irq_req_t {
u_int Attributes;
u_int AssignedIRQ;
u_int IRQInfo1, IRQInfo2;
u_int IRQInfo1, IRQInfo2; /* IRQInfo2 is ignored */
void *Handler;
void *Instance;
} irq_req_t;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment