2.6.0-test7 my cardbus card works (after a manual modprobe), but cardmgr never notices the insertion

Tim Shepard shep at alum.mit.edu
Thu Oct 30 01:12:43 GMT 2003


Before linux-2.6, i was running linux-2.4.2[01] kernels with no
problem, and I was using PCIC=i82365 in my /etc/default/pcmcia and
everything was working fine with both cardbus and non-cardbus cards.


I am now running linux-2.6.0-test7 with the patch sent recently and a
couple of printk()'s that I added to try to debug this problem.  (See
diffs at end of msg just to document the printfs and what patch I
applied.)

I boot my linux-2.6.0-test7 kernel, and then run '/etc/init.d/pcmcia start'.
Then I insert the card and nothing happens.   
But if I 'modprobe 3c59x' then the card starts working and I can
ifconfig it and start using it and everything is fine.  I've been
using it this way (manually modprobing 3c59x and then manually
ifconfiging) for a few weeks now with no problems.

I wanted to debug why cardmgr wasn't working.  I added a couple of
printks to make sure that the interrupt was getting to yenta_socket()
and that socket_detect_change() is being called.  As you can see below
with my added printk()'s, they are being called.

Then I got sources for cardmgr and tried to compile them, and
discovered that I don't know how to get the cardmgr from
pcmcia-cs-3.2.5, pcmcia-cs.09-Oct-03, or pcmcia-cs.29-Oct-03 to
compile with a linux-2.6.0-test7 kernel tree.  So my cardmgr is still
from the Debian pcmcia-cs 3.1.33-6 package.

I would appreciate any hints on how to get a working cardmgr (one that
actually wakes up and notices that a card has been inserted).

Should the cardmgr from the 3.1.33-6 Debian package work on a linux-2.6 kernel?
If not, how do I compile a 3.2.[56] cardmgr with a linux-2.6 kernel tree?

			-Tim Shepard
			 shep at alum.mit.edu

 - - -  - - -  - - -  - - -  - - -  - - -  - - -  - - -  - - - 

Here's some output that will show my system in some detail:

<12>$ cardctl status
Socket 0:
  3.3V CardBus card
  function 0: [ready]
Socket 1:
  no card
<13>$ cardctl ident 
Socket 0:
  product info: "3Com Corporation", "3CCFE575BT", "LAN Cardbus Card", "001"
  manfid: 0x0101, 0x5157
  function: 6 (network)
Socket 1:
  no product info available
<14>$ tail -25 /var/log/kern.log
Oct 30 00:18:55 localhost kernel: Disabled Privacy Extensions on device c04a80e0(lo)
Oct 30 00:18:55 localhost kernel: IPv6 over IPv4 tunneling driver
Oct 30 00:19:22 localhost kernel: Linux Kernel Card Services
Oct 30 00:19:22 localhost kernel:   options:  [pci] [cardbus] [pm]
Oct 30 00:19:22 localhost kernel: PCI: Found IRQ 11 for device 0000:00:0b.0
Oct 30 00:19:22 localhost kernel: Yenta: CardBus bridge found at 0000:00:0b.0 [1179:0001]
Oct 30 00:19:22 localhost kernel: Yenta: ISA IRQ list 0410, PCI irq11
Oct 30 00:19:22 localhost kernel: Socket status: 30000007
Oct 30 00:19:22 localhost kernel: PCI: Found IRQ 11 for device 0000:00:0b.1
Oct 30 00:19:22 localhost kernel: Yenta: CardBus bridge found at 0000:00:0b.1 [1179:0001]
Oct 30 00:19:22 localhost kernel: socket_detect_change: skt->state = 0x0, status = 0x51
Oct 30 00:19:22 localhost kernel: Yenta: ISA IRQ list 0410, PCI irq11
Oct 30 00:19:22 localhost kernel: Socket status: 30000007
Oct 30 00:19:22 localhost kernel: socket_detect_change: skt->state = 0x0, status = 0x51
Oct 30 00:19:23 localhost kernel: cs: IO port probe 0x0c00-0x0cff: clean.
Oct 30 00:19:23 localhost kernel: cs: IO port probe 0x0800-0x08ff: clean.
Oct 30 00:19:23 localhost kernel: cs: IO port probe 0x0100-0x04ff: excluding 0x220-0x22f 0x330-0x337 0x388-0x38f 0x3c0-0x3df 0x4d0-0x4d7
Oct 30 00:19:23 localhost kernel: cs: IO port probe 0x0a00-0x0aff: clean.
Oct 30 00:20:48 localhost kernel: yenta_interrupt: events = 0x80
Oct 30 00:20:48 localhost kernel: socket_detect_change: skt->state = 0x0, status = 0x1880
Oct 30 00:35:00 localhost kernel: PCI: Enabling device 0000:01:00.0 (0000 -> 0003)
Oct 30 00:35:00 localhost kernel: 3c59x: Donald Becker and others. www.scyld.com/network/vortex.html
Oct 30 00:35:00 localhost kernel: 0000:01:00.0: 3Com PCI 3CCFE575BT Cyclone CardBus at 0x1400. Vers LK1.1.19
Oct 30 00:35:00 localhost kernel: PCI: Setting latency timer of device 0000:01:00.0 to 64
Oct 30 00:35:23 localhost kernel: eth0: no IPv6 routers present
<15>$ lspci
00:00.0 Host bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled) (rev 03)
00:04.0 VGA compatible controller: Neomagic Corporation NM2200 [MagicGraph 256AV] (rev 12)
00:05.0 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ISA (rev 02)
00:05.1 IDE interface: Intel Corp. 82371AB/EB/MB PIIX4 IDE (rev 01)
00:05.2 USB Controller: Intel Corp. 82371AB/EB/MB PIIX4 USB (rev 01)
00:05.3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 02)
00:09.0 Communication controller: Toshiba America Info Systems FIR Port (rev 23)
00:0b.0 CardBus bridge: Toshiba America Info Systems ToPIC97 (rev 05)
00:0b.1 CardBus bridge: Toshiba America Info Systems ToPIC97 (rev 05)
01:00.0 Ethernet controller: 3Com Corporation 3c575 [Megahertz] 10/100 LAN CardBus (rev 01)
<16>$ lsmod
Module                  Size  Used by
3c59x                  38056  0 
ds                     15076  4 
yenta_socket           17280  1 
pcmcia_core            73152  2 ds,yenta_socket
ipv6                  256352  27 
usb_storage            41604  0 
ad1848                 33980  0 
sound                  83660  1 ad1848
<17>$ cat /tmp/mydiff 
diff -u11 -r ../pristine/linux-2.6.0-test7/drivers/pcmcia/cs.c drivers/pcmcia/cs.c
--- ../pristine/linux-2.6.0-test7/drivers/pcmcia/cs.c   2003-10-08 15:24:03.000000000 -0400
+++ drivers/pcmcia/cs.c 2003-10-29 22:02:52.000000000 -0500
@@ -747,22 +747,24 @@
 static void socket_detect_change(struct pcmcia_socket *skt)
 {
        if (!(skt->state & SOCKET_SUSPEND)) {
                int status;
 
                if (!(skt->state & SOCKET_PRESENT)) {
                        set_current_state(TASK_UNINTERRUPTIBLE);
                        schedule_timeout(cs_to_timeout(2));
                }
 
                skt->ops->get_status(skt, &status);
+               printk(KERN_DEBUG "%s: skt->state = 0x%x, status = 0x%x\n",
+                      __func__, skt->state, status);
                if ((skt->state & SOCKET_PRESENT) &&
                     !(status & SS_DETECT))
                        socket_remove(skt);
                if (!(skt->state & SOCKET_PRESENT) &&
                    (status & SS_DETECT))
                        socket_insert(skt);
        }
 }
 
 static int pccardd(void *__skt)
 {
diff -u11 -r ../pristine/linux-2.6.0-test7/drivers/pcmcia/yenta_socket.c drivers/pcmcia/yenta_socket.c
--- ../pristine/linux-2.6.0-test7/drivers/pcmcia/yenta_socket.c 2003-10-08 15:24:16.000000000 -0400
+++ drivers/pcmcia/yenta_socket.c       2003-10-30 00:32:49.000000000 -0500
@@ -416,22 +416,23 @@
        return events;
 }
 
 
 static irqreturn_t yenta_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
        unsigned int events;
        struct yenta_socket *socket = (struct yenta_socket *) dev_id;
 
        events = yenta_events(socket);
        if (events) {
+               printk(KERN_DEBUG "yenta_interrupt, events = 0x%x\n", events);
                pcmcia_parse_events(&socket->socket, events);
                return IRQ_HANDLED;
        }
        return IRQ_NONE;
 }
 
 static void yenta_interrupt_wrapper(unsigned long data)
 {
        struct yenta_socket *socket = (struct yenta_socket *) data;
 
        yenta_interrupt(0, (void *)socket, NULL);
@@ -453,34 +454,38 @@
        }
        for (i = 0; i < 5; i++) {
                mem.map = i;
                yenta_set_mem_map(&socket->socket, &mem);
        }
 }
 
 /* Called at resume and initialization events */
 static int yenta_sock_init(struct pcmcia_socket *sock)
 {
        struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket);
+       u32 state;
        u16 bridge;
 
        bridge = config_readw(socket, CB_BRIDGE_CONTROL) & ~CB_BRIDGE_INTR;
        if (!socket->cb_irq)
                bridge |= CB_BRIDGE_INTR;
        config_writew(socket, CB_BRIDGE_CONTROL, bridge);
 
        exca_writeb(socket, I365_GBLCTL, 0x00);
        exca_writeb(socket, I365_GENCTL, 0x00);
 
        /* Redo card voltage interrogation */
-       cb_writel(socket, CB_SOCKET_FORCE, CB_CVSTEST);
+       state = cb_readl(socket, CB_SOCKET_STATE);
+       if (!(state & (CB_CDETECT1 | CB_CDETECT2 | CB_5VCARD |
+                      CB_3VCARD | CB_XVCARD | CB_YVCARD)))
+               cb_writel(socket, CB_SOCKET_FORCE, CB_CVSTEST);
 
        yenta_clear_maps(socket);
 
        if (socket->type && socket->type->sock_init)
                socket->type->sock_init(socket);
 
        /* Re-enable CSC interrupts */
        cb_writel(socket, CB_SOCKET_MASK, CB_CDMASK);
 
        return 0;
 }




More information about the linux-pcmcia mailing list