PCMCIA problem after kernel updgrade (2.6.9)

2005-02-10
2013-04-08
  • Hi,

    I got a PCMCIA problem after upgrading the Kernel from 2.6.5 to 2.6.9. With 2.6.5 my Sedlbaur ISDN card loaded cleanly into the kernel, after I had changed my /etc/pcmcia/config.opts with port and memory ranges, that I borrowed from a Windows configuration.

    /etc/pcmcia/config.opts:
    include port 0x100-0x3af, port 0x3e0-0x4ff, port 0x800-0x80f, port 0x820-0x8ff,
    port 0xc00-0xcff
    include memory 0xd0116000-0xd011dfff, memory 0xd04fe000-0xd04fefff, memory 0xd02fe000-0xd04fdfff

    With 2.6.9 the pcmcia_core and yenta modules still load cleanly, but when the ISDN stuff is to be loaded, the sedlbauer_cs module reports
    kernel: sedlbauer_cs: GetNextTuple: No more items
    instead of
    kernel: sedlbauer: index 0x01: Vcc 5.0, irq 10, io 0x0260-0x0267,
    what it says when I start my 2.6.5 Kernel.

    > cardctl config (2.6.5) reports:
    Socket 0:
      Vcc 5.0V  Vpp1 0.0V  Vpp2 0.0V
      interface type is "memory and I/O"
      irq 10 [exclusive] [level]
      function 0:
        config base 0x0200
          option 0x41 status 0x00
        io 0x0260-0x0267 [8bit]
    > cardctl config (2.6.9) reports:
    Socket 0:
      Vcc 5.0V  Vpp1 5.0V  Vpp2 5.0V

    As the sedlbauer code did not change from 2.6.5 to 2.6.9, I am quite sure, the problem is related to the pcmcia_core and therefore I posted to this list. Google just helped me to find out, that after 2.6.8 the ressource management of the pcmcia driver has changed. Maybe my problem is related to that change, but I have no idea, how to make use of this information, if it was true.
    Yesterday, I tried the new Kernel 2.6.10, but I did not help.

    So, I am quite depressed, and considering if internet connections through an ISDN line aren't a bit outdated by now. But maybe I am wrong, and someone can show me that this technology is still usable. :-)

    Thanks in advance!

     
    • Hi,

      I am not very sure, if anyone has read my first posting, but tonight I got my ISDN card to work. And my "solution" is strange enough, that I think its worth a second posting. Here is my story:

      As the Changelog of Kernel 2.6.11-rc4 included many changes concerning PCMCIA and even my sedlbauer card, I applied the patch to my kernel sources. But I did not work.
      I browsed the sources and added simple debug messages to the code in order to find out, what function exactly returns an error and stops the initialisation of my card. By doing so, I also found out, that for anyone who wanted to answer my first question,  it might have been useful to know that I use an Athlon64 architecture with a yenta_socket driven PCMCIA controller. Well now, you know. ;-) Enabling standard debug support for PCMCIA showed me that the kernel fails to allocate an IO-Port Window for my card. The exact error message was:

      kernel: HiSax: LinkLayer Revision 2.59.2.4
      kernel: cs: pcmcia_socket0: read_cis_mem(1, 0x3f, 5)
      kernel: cs: pcmcia_socket0:   0x01 0x07 0x00 0x02 ...
      kernel: cs: pcmcia_socket0: read_cis_mem(1, 0x46, 13)
      kernel: cs: pcmcia_socket0:   0xc1 0x81 0x19 0x01 ...
      kernel: cs: pcmcia_socket0: odd IO request: base 0x260 align 0x8
      kernel: cs: pcmcia_socket0: read_cis_mem(1, 0x55, 7)
      kernel: cs: pcmcia_socket0:   0x02 0x08 0xaa 0x60 ...
      kernel: cs: pcmcia_socket0: odd IO request: base 0x270 align 0x8
      kernel: cs: pcmcia_socket0: read_cis_mem(1, 0x5e, 7)
      kernel: cs: pcmcia_socket0:   0x03 0x08 0xaa 0x60 ...
      kernel: cs: pcmcia_socket0: odd IO request: base 0x280 align 0x8
      kernel: cs: pcmcia_socket0: read_cis_mem(1, 0x67, 7)
      kernel: cs: pcmcia_socket0:   0x04 0x08 0xaa 0x60 ...
      kernel: cs: pcmcia_socket0: odd IO request: base 0x2e8 align 0x8
      kernel: cs: pcmcia_socket0: read_cis_mem(1, 0x70, 7)
      kernel: cs: pcmcia_socket0:   0x05 0x08 0xaa 0x60 ...
      kernel: cs: pcmcia_socket0: odd IO request: base 0x2f8 align 0x8
      kernel: cs: pcmcia_socket0: read_cis_mem(1, 0x79, 7)
      kernel: cs: pcmcia_socket0:   0x06 0x08 0xaa 0x60 ...
      kernel: cs: pcmcia_socket0: odd IO request: base 0x350 align 0x8
      kernel: cs: pcmcia_socket0: read_cis_mem(1, 0x82, 7)
      kernel: cs: pcmcia_socket0:   0x07 0x08 0xaa 0x60 ...
      kernel: cs: pcmcia_socket0: odd IO request: base 0x3e8 align 0x8
      kernel: 0.0: GetNextTuple: No more items

      My own error messages that I added to the source coded finally led me to the function "nonstatic_find_io_region" in drivers/pcmcia/rsrc_nonstatic.c that is used by yenta_socket. To my very surprise, the ISDN card suppenly worked after I added a "printk" that never executes. The file rsrc_nonstatic.c then looks like this:

      down(&rsrc_sem);
      #ifdef CONFIG_PCI
      if (s->cb_dev) {
                ret = pci_bus_alloc_resource(s->cb_dev->bus, res, num, 1,
                                              min, 0, pcmcia_align, &data);
      } else
      #endif
      printk("this string will never be printed, but it helps!!!");
               ret = allocate_resource(&ioport_resource, res, num, min, ~0UL,
                                      1, pcmcia_align, &data);
      up(&rsrc_sem);

      If printk is not there, allocate_resource returns with error code EBUSY. I do not understand that at all. Maybe my printk irritates the semaphore that is set around the allocate_resource? However, then my "solution" won't be very safe, although my card works perfectly now. I have only a basic understanding of those kernel functions, and wonder if someone can tell me, what this is all about.

      Thanks,
      Martin

       
      • David Hinds
        David Hinds
        2005-02-24

        Can you show your /proc/ioports?

        - Dave