提交 5bc6b68a 编写于 作者: R Russell King 提交者: Linus Torvalds

[PATCH] yenta: no CardBus if IRQ fails

If probing for the correct interrupt fails on yenta bridges, the driver falls
back to polling for interrupt actions.  However, CardBus cards cannot be used
then.
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: NDominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 4230dfc9
...@@ -215,6 +215,13 @@ int pcmcia_register_socket(struct pcmcia_socket *socket) ...@@ -215,6 +215,13 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
list_add_tail(&socket->socket_list, &pcmcia_socket_list); list_add_tail(&socket->socket_list, &pcmcia_socket_list);
up_write(&pcmcia_socket_list_rwsem); up_write(&pcmcia_socket_list_rwsem);
#ifndef CONFIG_CARDBUS
/*
* If we do not support Cardbus, ensure that
* the Cardbus socket capability is disabled.
*/
socket->features &= ~SS_CAP_CARDBUS;
#endif
/* set proper values in socket->dev */ /* set proper values in socket->dev */
socket->dev.class_data = socket; socket->dev.class_data = socket;
...@@ -448,11 +455,11 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay) ...@@ -448,11 +455,11 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay)
} }
if (status & SS_CARDBUS) { if (status & SS_CARDBUS) {
if (!(skt->features & SS_CAP_CARDBUS)) {
cs_err(skt, "cardbus cards are not supported.\n");
return CS_BAD_TYPE;
}
skt->state |= SOCKET_CARDBUS; skt->state |= SOCKET_CARDBUS;
#ifndef CONFIG_CARDBUS
cs_err(skt, "cardbus cards are not supported.\n");
return CS_BAD_TYPE;
#endif
} }
/* /*
......
...@@ -868,14 +868,11 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket) ...@@ -868,14 +868,11 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket)
*/ */
static void yenta_get_socket_capabilities(struct yenta_socket *socket, u32 isa_irq_mask) static void yenta_get_socket_capabilities(struct yenta_socket *socket, u32 isa_irq_mask)
{ {
socket->socket.features |= SS_CAP_PAGE_REGS | SS_CAP_PCCARD | SS_CAP_CARDBUS;
socket->socket.map_size = 0x1000;
socket->socket.pci_irq = socket->cb_irq; socket->socket.pci_irq = socket->cb_irq;
if (isa_probe) if (isa_probe)
socket->socket.irq_mask = yenta_probe_irq(socket, isa_irq_mask); socket->socket.irq_mask = yenta_probe_irq(socket, isa_irq_mask);
else else
socket->socket.irq_mask = 0; socket->socket.irq_mask = 0;
socket->socket.cb_dev = socket->dev;
printk(KERN_INFO "Yenta: ISA IRQ mask 0x%04x, PCI irq %d\n", printk(KERN_INFO "Yenta: ISA IRQ mask 0x%04x, PCI irq %d\n",
socket->socket.irq_mask, socket->cb_irq); socket->socket.irq_mask, socket->cb_irq);
...@@ -941,6 +938,9 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i ...@@ -941,6 +938,9 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
socket->socket.dev.dev = &dev->dev; socket->socket.dev.dev = &dev->dev;
socket->socket.driver_data = socket; socket->socket.driver_data = socket;
socket->socket.owner = THIS_MODULE; socket->socket.owner = THIS_MODULE;
socket->socket.features = SS_CAP_PAGE_REGS | SS_CAP_PCCARD;
socket->socket.map_size = 0x1000;
socket->socket.cb_dev = dev;
/* prepare struct yenta_socket */ /* prepare struct yenta_socket */
socket->dev = dev; socket->dev = dev;
...@@ -1011,6 +1011,10 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i ...@@ -1011,6 +1011,10 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i
socket->poll_timer.data = (unsigned long)socket; socket->poll_timer.data = (unsigned long)socket;
socket->poll_timer.expires = jiffies + HZ; socket->poll_timer.expires = jiffies + HZ;
add_timer(&socket->poll_timer); add_timer(&socket->poll_timer);
printk(KERN_INFO "Yenta: no PCI IRQ, CardBus support disabled for this socket.\n"
KERN_INFO "Yenta: check your BIOS CardBus, BIOS IRQ or ACPI settings.\n");
} else {
socket->socket.features |= SS_CAP_CARDBUS;
} }
/* Figure out what the dang thing can do for the PCMCIA layer... */ /* Figure out what the dang thing can do for the PCMCIA layer... */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册