Messages in this thread Patch in this message | | | Date | Thu, 5 Aug 2004 22:28:20 +0000 | From | Adam Belay <> | Subject | [PATCH] pcmcia driver model support [4/5] |
| |
[PCMCIA] fix eject lockup
It is not safe to use the skt_sem in pcmcia_validate_mem. This patch fixes a real world bug, and without it many systems will fail to shutdown properly. When pcmcia-cs calls DS_EJECT_CARD, it creates a CS_EVENT_EJECTION_REQUEST event. The event is then eventually reported to the ds.c client. DS then informs userspace of the ejection request and waits for userspace to reply with whether the request was successful. pcmcia-cs, in turn, calls DS_GET_FIRST_TUPLE while verifying the ejection request. Unfortunately, at this point the skt_sem semaphore is already held by pcmcia_eject_card. This results in the ds event code waiting forever for skt_sem to become available.
--- a/drivers/pcmcia/rsrc_mgr.c 2004-08-05 13:05:45.000000000 +0000 +++ b/drivers/pcmcia/rsrc_mgr.c 2004-08-05 21:31:32.000000000 +0000 @@ -520,12 +520,8 @@ void pcmcia_validate_mem(struct pcmcia_socket *s) { - down(&s->skt_sem); - if (probe_mem && s->state & SOCKET_PRESENT) validate_mem(s); - - up(&s->skt_sem); } EXPORT_SYMBOL(pcmcia_validate_mem); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |