Skip to content

Commit

Permalink
mmc: remove card upon suspend
Browse files Browse the repository at this point in the history
Suspending MMC/SD cards (versus removing and readding them) is an
inherently unsafe operation and has even been broken for some time.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
  • Loading branch information
Pierre Ossman committed May 1, 2007
1 parent d2b46f6 commit b5af25b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions drivers/mmc/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1738,10 +1738,17 @@ EXPORT_SYMBOL(mmc_free_host);
*/
int mmc_suspend_host(struct mmc_host *host, pm_message_t state)
{
mmc_claim_host(host);
mmc_deselect_cards(host);
struct list_head *l, *n;

mmc_flush_scheduled_work();

list_for_each_safe(l, n, &host->cards) {
struct mmc_card *card = mmc_list_to_card(l);

mmc_remove_card(card);
}

mmc_power_off(host);
mmc_release_host(host);

return 0;
}
Expand Down

0 comments on commit b5af25b

Please sign in to comment.