|
@@ -897,6 +897,7 @@ int __mmc_claim_host(struct mmc_host *host, atomic_t *abort)
|
|
DECLARE_WAITQUEUE(wait, current);
|
|
DECLARE_WAITQUEUE(wait, current);
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
int stop;
|
|
int stop;
|
|
|
|
+ bool pm = false;
|
|
|
|
|
|
might_sleep();
|
|
might_sleep();
|
|
|
|
|
|
@@ -916,13 +917,18 @@ int __mmc_claim_host(struct mmc_host *host, atomic_t *abort)
|
|
host->claimed = 1;
|
|
host->claimed = 1;
|
|
host->claimer = current;
|
|
host->claimer = current;
|
|
host->claim_cnt += 1;
|
|
host->claim_cnt += 1;
|
|
|
|
+ if (host->claim_cnt == 1)
|
|
|
|
+ pm = true;
|
|
} else
|
|
} else
|
|
wake_up(&host->wq);
|
|
wake_up(&host->wq);
|
|
spin_unlock_irqrestore(&host->lock, flags);
|
|
spin_unlock_irqrestore(&host->lock, flags);
|
|
remove_wait_queue(&host->wq, &wait);
|
|
remove_wait_queue(&host->wq, &wait);
|
|
|
|
+
|
|
|
|
+ if (pm)
|
|
|
|
+ pm_runtime_get_sync(mmc_dev(host));
|
|
|
|
+
|
|
return stop;
|
|
return stop;
|
|
}
|
|
}
|
|
-
|
|
|
|
EXPORT_SYMBOL(__mmc_claim_host);
|
|
EXPORT_SYMBOL(__mmc_claim_host);
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -947,6 +953,8 @@ void mmc_release_host(struct mmc_host *host)
|
|
host->claimer = NULL;
|
|
host->claimer = NULL;
|
|
spin_unlock_irqrestore(&host->lock, flags);
|
|
spin_unlock_irqrestore(&host->lock, flags);
|
|
wake_up(&host->wq);
|
|
wake_up(&host->wq);
|
|
|
|
+ pm_runtime_mark_last_busy(mmc_dev(host));
|
|
|
|
+ pm_runtime_put_autosuspend(mmc_dev(host));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(mmc_release_host);
|
|
EXPORT_SYMBOL(mmc_release_host);
|