From: Guennadi Liakhovetski Date: Wed, 4 Jan 2012 14:28:45 +0000 (+0100) Subject: mmc: fix a deadlock between system suspend and MMC block IO X-Git-Tag: v3.3-rc1~72^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0db13fc2abbb0b1a8d8efee20dfbd7f3c5d54022;p=pandora-kernel.git mmc: fix a deadlock between system suspend and MMC block IO Performing MMC block IO with simultaneous STR can lead to a deadlock: the mmc_pm_notify() function claims the host and then calls bus .remove() method, which lands in mmc_blk_remove(), which calls mmc_blk_remove_req() then it goes to -> mmc_cleanup_queue() -> kthread_stop(), which waits for the mmc-block thread to stop. If the mmc-block thread at that time is processing block requests, it will also try to claim the host in mmc_blk_issue_rq() and block there. This patch fixes the problem by calling .remove() before claiming the host. Signed-off-by: Guennadi Liakhovetski Acked-by: Arindam Nath Signed-off-by: Chris Ball --- Reading git-diff-tree failed