[PCMCIA] Fix race condition causing cards to be incorrectly recognised
This patch fixes a race condition between the pcmcia socket initial insert processing, ds.c and cardmgr. This allowed cardmgr to believe that a card was inserted while the card is still in the process of resetting itself, and it therefore tried to read the CIS while it was unavailable. We change the meaning of SOCKET_PRESENT slightly - it now means that a card is present _and we have completed its initialisation_. We introduce SOCKET_INUSE to indicate that we have a reference count against the module. We also take the skt_sem to prevent clients from registering while we're handling an insert/remove/suspend/resume.
Showing
Please register or sign in to comment