public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pcmcia driver model support [4/5]
@ 2004-08-05 22:28 Adam Belay
  2004-08-06 10:43 ` Russell King
  2004-08-23 18:05 ` Russell King
  0 siblings, 2 replies; 6+ messages in thread
From: Adam Belay @ 2004-08-05 22:28 UTC (permalink / raw)
  To: rmk; +Cc: linux, akpm, rml, linux-kernel, linux-pcmcia

[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);

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-08-23 18:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-05 22:28 [PATCH] pcmcia driver model support [4/5] Adam Belay
2004-08-06 10:43 ` Russell King
2004-08-06 10:35   ` Adam Belay
2004-08-06 10:44     ` Adam Belay
2004-08-23 18:05 ` Russell King
2004-08-23 18:16   ` Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox