PCMCIA-related breakage on suspend to disk
Matthew Garrett
mjg59 at srcf.ucam.org
Thu Nov 24 00:29:08 EST 2005
In the Ubuntu suspend to disk script, we eject all PCMCIA cards before
suspend in order to minimise problems caused by drivers that aren't
terribly happy with being suspended. This seems to cause the following
issue:
1) Userspace ejects the card
2) Userspace triggers suspend to disk
3) Userspace is frozen
4) The kernel suspends all hardware
5) An atomic copy of memory is made
6) The kernel resumes the hardware in order to write the image to disk
7) socket_resume is called
8) socket_resume calls socket_insert
9) The machine hangs
It's fairly clear /why/ socket_insert is called - it's possible that a
card has been inserted between suspend and resume (we call cardctl
insert from userspace in order to deal with this case). However, it
seems to cause problems in this specific case, and I don't understand
why. The following patch avoids the issue, but plainly isn't the correct
solution.
--- a/drivers/pcmcia/cs.c.orig 2005-09-20 18:38:17.000000000 +0100
+++ b/drivers/pcmcia/cs.c 2005-09-20 18:38:40.000000000 +0100
@@ -600,7 +600,8 @@ static int socket_resume(struct pcmcia_s
if (!(skt->state & SOCKET_PRESENT)) {
skt->state &= ~SOCKET_SUSPEND;
- return socket_insert(skt);
+ // return socket_insert(skt);
+ return 0;
}
ret = socket_setup(skt, resume_delay);
--
Matthew Garrett | mjg59 at srcf.ucam.org
More information about the linux-pcmcia
mailing list