Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 270305
b: refs/heads/master
c: b6ad726
h: refs/heads/master
i:
  270303: 4bb9aa6
v: v3
  • Loading branch information
Ulf Hansson authored and Chris Ball committed Oct 26, 2011
1 parent 53b7094 commit bbe7670
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b4625dab2c618eb87e177761dda3182b4cfaa604
refs/heads/master: b6ad726e3fe69e1ff3c3b2ad272ba3e4c376cd6a
42 changes: 27 additions & 15 deletions trunk/drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2294,21 +2294,33 @@ int mmc_suspend_host(struct mmc_host *host)

mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead) {
if (host->bus_ops->suspend)
err = host->bus_ops->suspend(host);
if (err == -ENOSYS || !host->bus_ops->resume) {
/*
* We simply "remove" the card in this case.
* It will be redetected on resume.
*/
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);
host->pm_flags = 0;
err = 0;

/*
* A long response time is not acceptable for device drivers
* when doing suspend. Prevent mmc_claim_host in the suspend
* sequence, to potentially wait "forever" by trying to
* pre-claim the host.
*/
if (mmc_try_claim_host(host)) {
if (host->bus_ops->suspend)
err = host->bus_ops->suspend(host);
if (err == -ENOSYS || !host->bus_ops->resume) {
/*
* We simply "remove" the card in this case.
* It will be redetected on resume.
*/
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);
host->pm_flags = 0;
err = 0;
}
mmc_do_release_host(host);
} else {
err = -EBUSY;
}
}
mmc_bus_put(host);
Expand Down

0 comments on commit bbe7670

Please sign in to comment.