Re: SS_CAP_STATIC_MAP and I/O resources manipulation in ide-cs and PCMCIA core

David Hinds <[email protected]> Thu, 13 Mar 2003 09:21:29 -0800
Newsgroups gmane.linux.pcmcia.devel
Message-ID <[email protected]>
On Thu, Mar 13, 2003 at 04:50:56PM +0300, Dmitry Antipov wrote:
> 
>  I'm working with a PCMCIA stuff on a custom PXA250-based board.
...
>  As I understand, PCMCIA core should allocate I/O region in 
> alloc_io_space() in cs.c. Then, this region should be freed by
> ide-cs in ide_config(). During the IDE shutdown, this region must be 
> re-allocated again in ide_release() and freed while unloading PCMCIA 
> core in release_io_space().
> 
>  Looks clear, but if SS_CAP_STATIC_MAP is set, no real resource 
> allocation/freeing is performed by PCMCIA core, isn't it ? And, ide-cs 
> knows nothing about it, and will try to free non-allocated resource in 
> ide_config(). And, after unloading IDE stuff, PCMCIA core doesn't 
> attempts to free resource re-allocated at ide-cs exit. As a result,
> I have "lost" ("owned" by unloaded module) resource. This is obviously 
> wrong, and causes kernel panic while 'cat /proc/ioports'.

Yes this is a bug; the PCMCIA core should have consistent resource
behavior with socket controllers using SS_CAP_STATIC_MAP, and it does
not.  The current code takes a short cut because resource management
is less critical with these controllers, since conflicts can't happen.
But I think it is misguided and this is one of several problems that
result.  It surprises me that it has not caused more complaints
because this seriously impacts use of several card types.

-- Dave


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en