Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53587
b: refs/heads/master
c: 6abaa0c
h: refs/heads/master
i:
  53585: 31a851d
  53583: 30197ba
v: v3
  • Loading branch information
Pierre Ossman committed May 1, 2007
1 parent aed07ad commit b8482aa
Show file tree
Hide file tree
Showing 7 changed files with 445 additions and 214 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: 89a73cf52ba2ae4402c53487b71ec4475544f139
refs/heads/master: 6abaa0c9fec563538f2a28a682af8c89bb9b125c
2 changes: 2 additions & 0 deletions trunk/drivers/mmc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ config MMC_DEBUG
This is an option for use by developers; most people should
say N here. This enables MMC core and driver debugging.

source "drivers/mmc/core/Kconfig"

source "drivers/mmc/card/Kconfig"

source "drivers/mmc/host/Kconfig"
Expand Down
17 changes: 17 additions & 0 deletions trunk/drivers/mmc/core/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# MMC core configuration
#

config MMC_UNSAFE_RESUME
bool "Allow unsafe resume (DANGEROUS)"
depends on MMC != n
help
If you say Y here, the MMC layer will assume that all cards
stayed in their respective slots during the suspend. The
normal behaviour is to remove them at suspend and
redetecting them at resume. Breaking this assumption will
in most cases result in data corruption.

This option is usually just for embedded systems which use
a MMC/SD card for rootfs. Most people should say N here.

29 changes: 23 additions & 6 deletions trunk/drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,14 +677,19 @@ int mmc_suspend_host(struct mmc_host *host, pm_message_t state)

mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead) {
if (host->bus_ops->remove)
host->bus_ops->remove(host);
mmc_detach_bus(host);
if (host->bus_ops->suspend)
host->bus_ops->suspend(host);
if (!host->bus_ops->resume) {
if (host->bus_ops->remove)
host->bus_ops->remove(host);

mmc_claim_host(host);
mmc_detach_bus(host);
mmc_release_host(host);
}
}
mmc_bus_put(host);

BUG_ON(host->card);

mmc_power_off(host);

return 0;
Expand All @@ -698,7 +703,19 @@ EXPORT_SYMBOL(mmc_suspend_host);
*/
int mmc_resume_host(struct mmc_host *host)
{
mmc_rescan(&host->detect.work);
mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead) {
mmc_power_up(host);
BUG_ON(!host->bus_ops->resume);
host->bus_ops->resume(host);
}
mmc_bus_put(host);

/*
* We add a slight delay here so that resume can progress
* in parallel.
*/
mmc_detect_change(host, 1);

return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/mmc/core/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
struct mmc_bus_ops {
void (*remove)(struct mmc_host *);
void (*detect)(struct mmc_host *);
void (*suspend)(struct mmc_host *);
void (*resume)(struct mmc_host *);
};

void mmc_attach_bus(struct mmc_host *host, const struct mmc_bus_ops *ops);
Expand Down
Loading

0 comments on commit b8482aa

Please sign in to comment.