Roy wrote:
> There is a legacy data card "U630” (PCMCIA). When plugged in a router
> with Linux 2.6.x code, there is the error from CS (card service),
> "cs: unable to map card memory!" It means that daemon of Card Service
> can not get the mapping space from Kernel. However, this card works
> well with our Linux 2.4 code.
> 
> I see the followings in the two cases…
> 
> BRCM Linux 2.4:
> ---------------
> pcmcia_adjust_resource_info() --> adjust_memory() --> add_interval()
> can allocate memory successful and store it into a global variable
> named "mem_db".
> 
> Then the function find_mem_region() can use the memory address stored
> in "mem_db".
> 
> 
> BRCM Linux 2.6:
> ---------------
> pcmcia_adjust_resource_info() --> adjust_memory() --> add_interval()
> can allocate memory successful, too.
> 
> But the system store it into a socket structure named "pcmcia_socket".
> The function pci_find_parent_resource() return 0 (It means the bus
> resource can not be found). pcmcia_find_mem_region() will be called in
> linux kernel 2.6 but finally sends error message “cs: unable to map
> card memory!”.
> 
> The I/O Memory which is needed by card service (PCMCIA) can be
> accessible in Linux 2.4 but can not work in Linux 2.6. I am wondering
> that the PCI Yenta Socket data structure changed in Linux 2.6 caused
> the issue. Appreciate comment & any tip to debug this issue.

If possible, please install the attached patch. It will let us know
which place failed in the find_mem callback routine. There are three
places that might be the cause.

Larry

Index: wireless-testing/drivers/pcmcia/rsrc_nonstatic.c
===================================================================
--- wireless-testing.orig/drivers/pcmcia/rsrc_nonstatic.c
+++ wireless-testing/drivers/pcmcia/rsrc_nonstatic.c
@@ -664,6 +664,9 @@ static struct resource * nonstatic_find_
        unsigned long min, max;
        int ret, i;
 
+       if (res)
+               printk(KERN_WARNING "pcmcia: make_resource failed in "
+                      "nonstatic_find_mem_region\n");
        low = low || !(s->features & SS_CAP_PAGE_REGS);
 
        data.mask = align - 1;
@@ -685,10 +688,19 @@ static struct resource * nonstatic_find_
                        ret = pci_bus_alloc_resource(s->cb_dev->bus, res, num,
                                                     1, min, 0,
                                                     pcmcia_align, &data);
+                       if (ret)
+                               printk(KERN_WARNING "pcmcia: pci_bus_alloc_"
+                                      "resource returned %d\n", ret);
                } else
 #endif
+               {
                        ret = allocate_resource(&iomem_resource, res, num, min,
                                                max, 1, pcmcia_align, &data);
+                       if (ret)
+                               printk(KERN_WARNING "pcmcia: allocate_"
+                                      "resource returned %d\n", ret);
+               }
+
                mutex_unlock(&rsrc_mutex);
                if (ret == 0 || low)
                        break;
_______________________________________________
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia

Reply via email to