mmc: core: Add deferred resume support to CQ
Defer the resume of the device until a request actually arrives, thus mandating the use of the device. CRs-fixed: 987918 Change-Id: I41cf8908dd0f129c54b941c318e938ad7e9d36c9 Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
This commit is contained in:
parent
f88fc3eaa6
commit
21de67ad10
2 changed files with 13 additions and 0 deletions
|
@ -3570,6 +3570,10 @@ static int mmc_blk_cmdq_issue_rq(struct mmc_queue *mq, struct request *req)
|
||||||
|
|
||||||
mmc_get_card(card);
|
mmc_get_card(card);
|
||||||
|
|
||||||
|
#ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME
|
||||||
|
if (mmc_bus_needs_resume(card->host))
|
||||||
|
mmc_resume_bus(card->host);
|
||||||
|
#endif
|
||||||
if (!card->host->cmdq_ctx.active_reqs && mmc_card_doing_bkops(card)) {
|
if (!card->host->cmdq_ctx.active_reqs && mmc_card_doing_bkops(card)) {
|
||||||
ret = mmc_cmdq_halt(card->host, true);
|
ret = mmc_cmdq_halt(card->host, true);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
|
@ -3051,6 +3051,7 @@ static inline void mmc_bus_put(struct mmc_host *host)
|
||||||
int mmc_resume_bus(struct mmc_host *host)
|
int mmc_resume_bus(struct mmc_host *host)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
int err = 0;
|
||||||
|
|
||||||
if (!mmc_bus_needs_resume(host))
|
if (!mmc_bus_needs_resume(host))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -3066,6 +3067,14 @@ int mmc_resume_bus(struct mmc_host *host)
|
||||||
mmc_power_up(host, host->card->ocr);
|
mmc_power_up(host, host->card->ocr);
|
||||||
BUG_ON(!host->bus_ops->resume);
|
BUG_ON(!host->bus_ops->resume);
|
||||||
host->bus_ops->resume(host);
|
host->bus_ops->resume(host);
|
||||||
|
if (mmc_card_cmdq(host->card)) {
|
||||||
|
err = mmc_cmdq_halt(host, false);
|
||||||
|
if (err)
|
||||||
|
pr_err("%s: %s: unhalt failed: %d\n",
|
||||||
|
mmc_hostname(host), __func__, err);
|
||||||
|
else
|
||||||
|
mmc_card_clr_suspended(host->card);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (host->bus_ops->detect && !host->bus_dead)
|
if (host->bus_ops->detect && !host->bus_dead)
|
||||||
|
|
Loading…
Add table
Reference in a new issue