Skip to content
Browse files

mmc: core: Claim host while freeing card

When SD/MMC card is removed without unmounting and
then reinserted again while gendisk is freed. Partition
invalidation and deletion may take more than 10secs during
which SDCC controller can suspend due to runtime pm functionality.
Once the block layer activity is done it claims host to detach card
from MMC bus which triggers SDCC resume. As the host->card is
NULL  already there is a BUG_ON hit in mmc_sd_resume(). Fix this
by claiming host even before we free host->card.

CRs-Fixed: 284262
Signed-off-by: Sujith Reddy Thumma <sthumma@codeaurora.org>
(cherry picked from commit 5eed6a9778440ef512f597b43368337a7ef9438b)

Change-Id: I6b58aab1865a93a025fd9912200ab0beea21be92
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
  • Loading branch information...
1 parent 13ad0a8 commit 55f9426230e9649450b3c217a5a35314b2ad953d Sujith Reddy Thumma committed with drowningchild Apr 28, 2011
Showing with 6 additions and 0 deletions.
  1. +3 −0 drivers/mmc/core/mmc.c
  2. +3 −0 drivers/mmc/core/sd.c
View
3 drivers/mmc/core/mmc.c
@@ -532,7 +532,10 @@ static void mmc_remove(struct mmc_host *host)
BUG_ON(!host->card);
mmc_remove_card(host->card);
+
+ mmc_claim_host(host);
host->card = NULL;
+ mmc_release_host(host);
}
/*
View
3 drivers/mmc/core/sd.c
@@ -559,7 +559,10 @@ static void mmc_sd_remove(struct mmc_host *host)
BUG_ON(!host->card);
mmc_remove_card(host->card);
+
+ mmc_claim_host(host);
host->card = NULL;
+ mmc_release_host(host);
}
/*

0 comments on commit 55f9426

Please sign in to comment.
Something went wrong with that request. Please try again.