Yenta and IRQ0

Russell King rmk+pcmcia at arm.linux.org.uk
Thu Aug 12 11:12:34 EDT 2004


On Wed, Aug 11, 2004 at 11:59:48PM +0900, Komuro wrote:
> 
> >> 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
> >> 
> 
> Your yenta_socket patch is wrong.

Argh, I obviously had not recovered from the .ca timezone.  This one
will only complain if we either have no IRQ assigned, or if we are
unable to claim the IRQ.

Therefore, we only set SS_CAP_CARDBUS if we have a non-zero IRQ _and_
we have successfully claimed it.

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);
+		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... */


-- 
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