]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
mmc: fix all hangs related to mmc/sd card insert/removal during suspend/resume
authorMaxim Levitsky <maximlevitsky@gmail.com>
Wed, 11 Aug 2010 01:01:41 +0000 (18:01 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Sep 2010 20:36:36 +0000 (13:36 -0700)
commit094b59b2cff1d17310037e957c7e343921d86aaa
tree89adf8591005da4659be0fd1dbf653060d4e2db5
parent77dc28848881926ba46e9b6bb9f64fb71d61bddc
mmc: fix all hangs related to mmc/sd card insert/removal during suspend/resume

commit 4c2ef25fe0b847d2ae818f74758ddb0be1c27d8e upstream.

If you don't use CONFIG_MMC_UNSAFE_RESUME, as soon as you attempt to
suspend, the card will be removed, therefore this patch doesn't change the
behavior of this option.

However the removal will be done by pm notifier, which runs while
userspace is still not frozen and thus can freely use del_gendisk, without
the risk of deadlock which would happen otherwise.

Card detect workqueue is now disabled while userspace is frozen, Therefore
if you do use CONFIG_MMC_UNSAFE_RESUME, and remove the card during
suspend, the removal will be detected as soon as userspace is unfrozen,
again at the moment it is safe to call del_gendisk.

Tested with and without CONFIG_MMC_UNSAFE_RESUME with suspend and hibernate.

[akpm@linux-foundation.org: clean up function prototype]
[akpm@linux-foundation.org: fix CONFIG_PM-n linkage, small cleanups]
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Lee Jones <lee.jones@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/mmc/core/core.c
drivers/mmc/core/host.c
include/linux/mmc/host.h