Yenta and IRQ0

Russell King rmk+pcmcia at arm.linux.org.uk
Tue Aug 10 15:17:35 EDT 2004


On Tue, Aug 10, 2004 at 12:11:07PM -0700, David Hinds wrote:
> On Tue, Aug 10, 2004 at 07:52:06PM +0100, Russell King wrote:
> > 
> > How about this patch then... goes on top of 2.6.8-rc4.  Only compile
> > tested though.
> 
> Seems ok... though I would also add a message, like:

Bah, I knew I missed something!  Updated patch included.

> 
>   Yenta: no PCI irq, CardBus support will be disabled
> 
> ?
> 
> As for specifically saying to check BIOS and/or ACPI settings, I'm not
> sure; there is already a message from the PCI layer which makes the
> usually unhelpful suggestion of booting with pci=biosirq.  A better
> message there might be in order.

That's only for one specific case (that I don't remember), though even
when it does show, we sometimes do have a working IRQ anyway.

diff -up -x BitKeeper -x ChangeSet -x SCCS -x _xlk -x *.orig -x *.rej orig/drivers/pcmcia/cs.c linux/drivers/pcmcia/cs.c
--- orig/drivers/pcmcia/cs.c	Sun Jul 11 22:54:53 2004
+++ linux/drivers/pcmcia/cs.c	Tue Aug 10 19:32:59 2004
@@ -240,6 +240,13 @@ int pcmcia_register_socket(struct pcmcia
 	list_add_tail(&socket->socket_list, &pcmcia_socket_list);
 	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 */
 	socket->dev.class_data = socket;
@@ -517,11 +524,11 @@ static int socket_setup(struct pcmcia_so
 	}
 
 	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;
-#ifndef CONFIG_CARDBUS
-		cs_err(skt, "cardbus cards are not supported.\n");
-		return CS_BAD_TYPE;
-#endif
 	}
 
 	/*
diff -up -x BitKeeper -x ChangeSet -x SCCS -x _xlk -x *.orig -x *.rej orig/drivers/pcmcia/yenta_socket.c linux/drivers/pcmcia/yenta_socket.c
--- orig/drivers/pcmcia/yenta_socket.c	Sun Jul 11 22:54:54 2004
+++ linux/drivers/pcmcia/yenta_socket.c	Tue Aug 10 19:34:59 2004
@@ -845,11 +845,8 @@ static int yenta_probe_cb_irq(struct yen
  */
 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.irq_mask = yenta_probe_irq(socket, isa_irq_mask);
-	socket->socket.cb_dev = socket->dev;
 
 	printk(KERN_INFO "Yenta: ISA IRQ mask 0x%04x, PCI irq %d\n",
 	       socket->socket.irq_mask, socket->cb_irq);
@@ -914,6 +911,9 @@ static int __devinit yenta_probe (struct
 	socket->socket.dev.dev = &dev->dev;
 	socket->socket.driver_data = socket;
 	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 */
 	socket->dev = dev;
@@ -984,6 +984,10 @@ static int __devinit yenta_probe (struct
 		socket->poll_timer.data = (unsigned long)socket;
 		socket->poll_timer.expires = jiffies + HZ;
 		add_timer(&socket->poll_timer);
+	} else {
+		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");
+		socket->socket.features |= SS_CAP_CARDBUS;
 	}
 
 	/* Figure out what the dang thing can do for the PCMCIA layer... */


-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core



More information about the linux-pcmcia mailing list