• Russell King's avatar
    [PCMCIA] Fix race condition causing cards to be incorrectly recognised · 6dbb44ac
    Russell King authored
    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.
    6dbb44ac
cs_internal.h 6.25 KB