From f82d299f3157759fd479dffbff45c4c991acd3f6 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Wed, 4 Jan 2012 15:28:45 +0100 Subject: [PATCH] --- yaml --- r: 284535 b: refs/heads/master c: 0db13fc2abbb0b1a8d8efee20dfbd7f3c5d54022 h: refs/heads/master i: 284533: ce822bcf92c54e3011dd70a9ddcdfddcfbd78b01 284531: 5329fee0929175e49d1a40a8483dcbc11934257a 284527: dd009a288e68ac9b1a51317842852c3373bc2548 v: v3 --- [refs] | 2 +- trunk/drivers/mmc/core/core.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 5651f4c5e1ea..88f869b878e1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3abc1e804253add41990cbe1461e79c1165108e0 +refs/heads/master: 0db13fc2abbb0b1a8d8efee20dfbd7f3c5d54022 diff --git a/trunk/drivers/mmc/core/core.c b/trunk/drivers/mmc/core/core.c index 1da45e051328..bec0bf21c879 100644 --- a/trunk/drivers/mmc/core/core.c +++ b/trunk/drivers/mmc/core/core.c @@ -2175,6 +2175,7 @@ void mmc_stop_host(struct mmc_host *host) mmc_bus_get(host); if (host->bus_ops && !host->bus_dead) { + /* Calling bus_ops->remove() with a claimed host can deadlock */ if (host->bus_ops->remove) host->bus_ops->remove(host); @@ -2398,7 +2399,9 @@ int mmc_suspend_host(struct mmc_host *host) if (err == -ENOSYS || !host->bus_ops->resume) { /* * We simply "remove" the card in this case. - * It will be redetected on resume. + * It will be redetected on resume. (Calling + * bus_ops->remove() with a claimed host can + * deadlock.) */ if (host->bus_ops->remove) host->bus_ops->remove(host); @@ -2491,11 +2494,11 @@ int mmc_pm_notify(struct notifier_block *notify_block, if (!host->bus_ops || host->bus_ops->suspend) break; - mmc_claim_host(host); - + /* Calling bus_ops->remove() with a claimed host can deadlock */ if (host->bus_ops->remove) host->bus_ops->remove(host); + mmc_claim_host(host); mmc_detach_bus(host); mmc_power_off(host); mmc_release_host(host);