diff options
author | Sujit Reddy Thumma <sthumma@codeaurora.org> | 2011-11-22 22:13:18 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-12-10 16:18:39 -0500 |
commit | 49df78074963c97e25debc3c67b72f059111607d (patch) | |
tree | 8e5e8779f9c3228b5a04044bc077b78eac456fc2 /drivers/mmc | |
parent | 524bfca2b42a7c9dc43af13e1592b21dd1ce3fcc (diff) |
mmc: core: Fix deadlock when the CONFIG_MMC_UNSAFE_RESUME is not defined
mmc_suspend_host() tries to claim host during suspend
and release it only when the bus suspend operation is
compeleted. If CONFIG_MMC_UNSAFE_RESUME is defined and
the host is flagged as removable, mmc_suspend_host()
tries to remove the card. In this process, the file system
sync can get blocked trying to acquire host which is already
claimed by mmc_suspend_host() causing deadlock.
Fix this deadlock by releasing host before ->remove() is called.
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Acked-by: Ulf Hansson <ulf.hansson@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/core/core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 271efeac860b..950b97d7412a 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -2333,6 +2333,8 @@ int mmc_suspend_host(struct mmc_host *host) | |||
2333 | mmc_poweroff_notify(host); | 2333 | mmc_poweroff_notify(host); |
2334 | err = host->bus_ops->suspend(host); | 2334 | err = host->bus_ops->suspend(host); |
2335 | } | 2335 | } |
2336 | mmc_do_release_host(host); | ||
2337 | |||
2336 | if (err == -ENOSYS || !host->bus_ops->resume) { | 2338 | if (err == -ENOSYS || !host->bus_ops->resume) { |
2337 | /* | 2339 | /* |
2338 | * We simply "remove" the card in this case. | 2340 | * We simply "remove" the card in this case. |
@@ -2347,7 +2349,6 @@ int mmc_suspend_host(struct mmc_host *host) | |||
2347 | host->pm_flags = 0; | 2349 | host->pm_flags = 0; |
2348 | err = 0; | 2350 | err = 0; |
2349 | } | 2351 | } |
2350 | mmc_do_release_host(host); | ||
2351 | } else { | 2352 | } else { |
2352 | err = -EBUSY; | 2353 | err = -EBUSY; |
2353 | } | 2354 | } |