linux-avmb1:Re: b1 pcmcia stopped working after (k)utuntu hoary->breezy update (2.6.10 -> 2.6.12)

Achim Bohnet ach at mpe.mpg.de
Thu Nov 3 00:50:02 CET 2005


On Wednesday 02 November 2005 23:43, you wrote:
> Hi,
> after upgrading Kubuntu from Hoary (2.6.10-5-686) to Breezy (2.6.12-9-686),
> the B1 pcmcia card stopped working.  kernel complains:
> 
> Nov  2 23:33:30 localhost kernel: [4382438.574000] CAPI Subsystem Rev 1.1.2.8
> Nov  2 23:33:30 localhost kernel: [4382438.631000] b1: revision 1.1.2.2
> Nov  2 23:33:30 localhost kernel: [4382438.672000] b1pci: revision 1.1.2.2
> Nov  2 23:33:30 localhost kernel: [4382438.704000] avm_cs: testing i/o 0x150-0x16f
> Nov  2 23:33:30 localhost kernel: [4382438.744000] b1pcmcia: unable to get IRQ 11.
> Nov  2 23:33:30 localhost kernel: [4382438.744000] avm_cs: failed to add AVM-B1-Controller at i/o 0x150, irq 11
[...snip-snap...] 

Looks like the only real change between 2.6.10 -> 2.6.12 ubuntu kernels is the
interrupt handling: removal of irq_list param and therefore
list->irq.IRQInfo2 checks in avm_cs.c

diff -u ./linux-source-2.6.10/drivers/isdn/hardware/avm/avm_cs.c ./linux-source-2.6.12/drivers/isdn/hardware/avm/avm_cs.c
--- ./linux-source-2.6.10/drivers/isdn/hardware/avm/avm_cs.c	2004-12-24 22:33:49.000000000 +0100
+++ ./linux-source-2.6.12/drivers/isdn/hardware/avm/avm_cs.c	2005-06-17 21:48:29.000000000 +0200
@@ -43,16 +43,6 @@
 
 /*====================================================================*/
 
-/* Parameters that can be set with 'insmod' */
-
-/* This means pick from 15, 12, 11, 10, 9, 7, 5, 4, and 3 */
-static int default_irq_list[10] = { 15, 12, 11, 10, 9, 7, 5, 4, 3, -1 };
-static int irq_list[10] = { -1 };
-
-MODULE_PARM(irq_list, "1-10i");
-
-/*====================================================================*/
-
 /*
    The event() function is this driver's Card Services event handler.
    It will be called by Card Services when an appropriate card status
@@ -134,7 +124,7 @@
     client_reg_t client_reg;
     dev_link_t *link;
     local_info_t *local;
-    int ret, i;
+    int ret;
     
     /* Initialize the dev_link_t structure */
     link = kmalloc(sizeof(struct dev_link_t), GFP_KERNEL);
@@ -151,14 +141,7 @@
     link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
     link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
 
-    link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;
-    if (irq_list[0] != -1) {
-	    for (i = 0; i < 10 && irq_list[i] > 0; i++)
-	       link->irq.IRQInfo2 |= 1 << irq_list[i];
-    } else {
-	    for (i = 0; i < 10 && default_irq_list[i] > 0; i++)
-	       link->irq.IRQInfo2 |= 1 << default_irq_list[i];
-    }
+    link->irq.IRQInfo1 = IRQ_LEVEL_ID;
     
     /* General socket configuration */
     link->conf.Attributes = CONF_ENABLE_IRQ;
@@ -178,7 +161,6 @@
     link->next = dev_list;
     dev_list = link;
     client_reg.dev_info = &dev_info;
-    client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
     client_reg.EventMask =
 	CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
 	CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
@@ -521,13 +503,7 @@
 static void __exit avmcs_exit(void)
 {
 	pcmcia_unregister_driver(&avmcs_driver);
-
-	/* XXX: this really needs to move into generic code.. */
-	while (dev_list != NULL) {
-		if (dev_list->state & DEV_CONFIG)
-			avmcs_release(dev_list);
-		avmcs_detach(dev_list);
-	}
+	BUG_ON(dev_list != NULL);
 }
 
 module_init(avmcs_init);
diff -u ./linux-source-2.6.10/drivers/isdn/hardware/avm/avmcard.h ./linux-source-2.6.12/drivers/isdn/hardware/avm/avmcard.h
--- ./linux-source-2.6.10/drivers/isdn/hardware/avm/avmcard.h	2004-12-24 22:35:28.000000000 +0100
+++ ./linux-source-2.6.12/drivers/isdn/hardware/avm/avmcard.h	2005-06-17 21:48:29.000000000 +0200
@@ -89,7 +89,7 @@
 	char msgbuf[128];	/* capimsg msg part */
 	char databuf[2048];	/* capimsg data part */
 
-	void *mbase;
+	void __iomem *mbase;
 	volatile u32 csr;
 	avmcard_dmainfo *dma;
 
diff -u ./linux-source-2.6.10/drivers/isdn/hardware/avm/b1pci.c ./linux-source-2.6.12/drivers/isdn/hardware/avm/b1pci.c
--- ./linux-source-2.6.10/drivers/isdn/hardware/avm/b1pci.c	2004-12-24 22:33:49.000000000 +0100
+++ ./linux-source-2.6.12/drivers/isdn/hardware/avm/b1pci.c	2005-06-17 21:48:29.000000000 +0200
@@ -391,7 +391,7 @@
 		strcpy(rev, "1.0");
 
 
-	err = pci_module_init(&b1pci_pci_driver);
+	err = pci_register_driver(&b1pci_pci_driver);
 	if (!err) {
 		strlcpy(capi_driver_b1pci.revision, rev, 32);
 		register_capi_driver(&capi_driver_b1pci);
diff -u ./linux-source-2.6.10/drivers/isdn/hardware/avm/b1pcmcia.c ./linux-source-2.6.12/drivers/isdn/hardware/avm/b1pcmcia.c
--- ./linux-source-2.6.10/drivers/isdn/hardware/avm/b1pcmcia.c	2004-12-24 22:33:47.000000000 +0100
+++ ./linux-source-2.6.12/drivers/isdn/hardware/avm/b1pcmcia.c	2005-06-17 21:48:29.000000000 +0200
@@ -200,7 +200,6 @@
 {
 	char *p;
 	char rev[32];
-	int err;
 
 	if ((p = strchr(revision, ':')) != 0 && p[1]) {
 		strlcpy(rev, p + 2, 32);
diff -u ./linux-source-2.6.10/drivers/isdn/hardware/avm/c4.c ./linux-source-2.6.12/drivers/isdn/hardware/avm/c4.c
--- ./linux-source-2.6.10/drivers/isdn/hardware/avm/c4.c	2004-12-24 22:34:58.000000000 +0100
+++ ./linux-source-2.6.12/drivers/isdn/hardware/avm/c4.c	2005-06-17 21:48:29.000000000 +0200
@@ -1288,7 +1288,7 @@
 	} else
 		strcpy(rev, "1.0");
 
-	err = pci_module_init(&c4_pci_driver);
+	err = pci_register_driver(&c4_pci_driver);
 	if (!err) {
 		strlcpy(capi_driver_c2.revision, rev, 32);
 		register_capi_driver(&capi_driver_c2);
diff -u ./linux-source-2.6.10/drivers/isdn/hardware/avm/t1pci.c ./linux-source-2.6.12/drivers/isdn/hardware/avm/t1pci.c
--- ./linux-source-2.6.10/drivers/isdn/hardware/avm/t1pci.c	2004-12-24 22:34:00.000000000 +0100
+++ ./linux-source-2.6.12/drivers/isdn/hardware/avm/t1pci.c	2005-06-17 21:48:29.000000000 +0200
@@ -241,7 +241,7 @@
 	} else
 		strcpy(rev, "1.0");
 
-	err = pci_module_init(&t1pci_pci_driver);
+	err = pci_register_driver(&t1pci_pci_driver);
 	if (!err) {
 		strlcpy(capi_driver_t1pci.revision, rev, 32);
 		register_capi_driver(&capi_driver_t1pci);


> Anyone a hint how to make b1pcmcia use the free interrupt 3 again?
> I've played with config.opts and avm.conf in /etc/pcmcia/ without success :(

Still no idea how to manipulate irq assignment :(
Is it 'save' to undo the avm_cs changes reintroducing the irq_list
stuff and IRQInfo2 check? 

Achim
-- 
  To me vi is Zen.  To use vi is to practice zen. Every command is
  a koan. Profound to the user, unintelligible to the uninitiated.
  You discover truth everytime you use it.
                                      -- reddy at lion.austin.ibm.com



More information about the linux-avmb1 mailing list