--- zzzz-none-000/linux-2.4.17/drivers/pcmcia/cs.c 2001-12-21 17:41:55.000000000 +0000 +++ sangam-fb-322/linux-2.4.17/drivers/pcmcia/cs.c 2004-11-24 13:23:44.000000000 +0000 @@ -675,10 +675,17 @@ static void parse_events(void *info, u_int events) { socket_info_t *s = info; + if (events & SS_DETECT) { int status; get_socket_status(s, &status); + + /* + * If our socket state indicates that a card is present and + * either the socket has not been suspended (for some reason) + * or the card has been removed, shut down the socket first. + */ if ((s->state & SOCKET_PRESENT) && (!(s->state & SOCKET_SUSPEND) || !(status & SS_DETECT)))