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

Pavel Roskin proski at gnu.org
Sat Apr 19 15:32:58 BST 2003


On Sat, 19 Apr 2003, Russell King wrote:

> Static socket resources are handled *completely* wrongly.  They're so
> wrong that the best thing to do is to rip them out and let your dog
> pee on them.

Agreed :-)

I already have plx9052 code that can remap both I/O and memory windows, so 
the problem becomes less important for me.

By the way, there is one very nasty problem with plx9052 that may need to
be taken into account when rewriting the resource handling.  It can only
make windows that are powers of two and that are allocated at the address
that is a multiple of the window size.  In other words, I can only choose
which address lines to enable and which to set to predefined values.

Following happened to me yesterday.  I inserted a D-Link DWL-650H card
that wants an I/O window 0x48 bytes long.  cardmgr requested ports
0x100-0x147.  The driver moved the I/O window to 0x100 and enabled address
lines necessary to cover the whole window, i.e. that became 0x100-0x17f.  
The bad thing is that my IDE controller uses 0170-0177.  IDE stopped
working immediately, so I had to reset the system.

The workaround I want to use is to try to use request_region() for the
rest of the window in the plx9052 driver.  Note that it would be two 
windows if e.g. 0x108-0x147 was requested (0x100-0x107 and 0x148-0x17f).

I think it's ugly.  The only straight solution I can think of would be to
let the socket driver reserve all resources itself.

-- 
Regards,
Pavel Roskin




More information about the linux-pcmcia mailing list