summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2007-02-11 20:43:19 +0100
committerPierre Ossman <drzeus@drzeus.cx>2007-05-01 13:04:17 +0200
commit3b91e5507cddaca53bccf1524ff11a0ac5c85531 (patch)
tree50d0df36aafa5b8f3a0abd5753457e50a3638041 /drivers/mmc
parent1c6a0718f0bfdab0d9b7da5f7b74f38a0058c03a (diff)
mmc: Flush pending detects on host removal
Make sure we kill of any pending detection runs when the host is removed instead of when it is freed. Also add some debugging to make sure the driver doesn't queue up more detection after it has removed the host. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/mmc.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 9ffeeb2cba45..0242c6a21daf 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1550,6 +1550,12 @@ static void mmc_setup(struct mmc_host *host)
*/
void mmc_detect_change(struct mmc_host *host, unsigned long delay)
{
+#ifdef CONFIG_MMC_DEBUG
+ mmc_claim_host(host);
+ BUG_ON(host->removed);
+ mmc_release_host(host);
+#endif
+
mmc_schedule_delayed_work(&host->detect, delay);
}
@@ -1690,6 +1696,14 @@ void mmc_remove_host(struct mmc_host *host)
{
struct list_head *l, *n;
+#ifdef CONFIG_MMC_DEBUG
+ mmc_claim_host(host);
+ host->removed = 1;
+ mmc_release_host(host);
+#endif
+
+ mmc_flush_scheduled_work();
+
list_for_each_safe(l, n, &host->cards) {
struct mmc_card *card = mmc_list_to_card(l);
@@ -1710,7 +1724,6 @@ EXPORT_SYMBOL(mmc_remove_host);
*/
void mmc_free_host(struct mmc_host *host)
{
- mmc_flush_scheduled_work();
mmc_free_host_sysfs(host);
}