two trivial PCMCIA patches [Was: three trivial PCMCIA patches]

Pavel Roskin proski at
Mon Apr 21 03:27:42 BST 2003

On Sat, 19 Apr 2003, Russell King wrote:

> Indeed.  You really should look at:
> especially pcmcia-3b.diff, which is work in progress.  It isn't ideal,
> and the resource handling still isn't right; although we now attempt
> to claim resources for static mapped sockets, it doesn't fit your
> problem area yet, since you are effectively a windowed driver but
> with restrictions.

I have looked, but I haven't tried to test it yet.  Most important for me 
is that the problem is acknowledged and being dealt with.

As for PLX9052 driver, I'm trying to use the existing architecture or now.  
Dynamic memory and I/O windows have been implemented.  Unaligned resources
like 0x100-0x147 will be split into different windows (that would be
0x100-0x13f and 0x140-0x147).

However, I'll be happy to use the new architecture when it's ready.

> My thoughts in this area is that we want to make combine mapstatic.c
> with the statically mapped socket drivers, and provide mapwindow.c
> as a library for windowed sockets to use.  We also need to change the
> socket driver set_mem_map and set_io_map methods to be something more
> like the mem_map and mem_unmap methods of the mapping stuff in 3b.

I'm not sure I understand that.  It would be very helpful if you convert
at least one driver to the new interface.

> The main problem area is working out how not to expose the CIS mapping
> to the socket drivers, who should have no knowledge that CIS is anything
> special.

By the way, PLX9052 has no way of telling if the card is inserted (as far
as I know), so I use one of the windows internally to check CIS.  If the
CIS begins with 1, I'm assuming that the card is inserted (yes, it's very
ugly and unreliable).

On top of that, pcmcia_core allocates another memory window for CIS.  
PLX9052 has 4 windows (I call them areas in the driver to distinguish them
from windows requested by pcmcia_core), and two are used for CIS, so only
2 windows are left for the driver (either for I/O or for memory).  This is
pretty tight (especially if I start splitting unaligned windows).  The
driver is here:

I hope if the driver allocates memory windows itself, it will also call
ioremap() on them.  Then I'll be able to identify the CIS window and reuse
it in the driver rather than put a workaround in hardware.

Actually, I may be missing some very simple solution to reuse the CIS 
window.  Anyway.

Pavel Roskin

More information about the linux-pcmcia mailing list