mmc: card: stop BKOPS in mmc_blk_cmdq_issue_rq

In case there are no pending requests, runtime idle API can be
invoked and start manual BKOPS.
We need to check if manual BKOPS is enabled on the device and stop
it before serving new incoming requests in CQ mode.

Change-Id: I870eff40ea9fa91eedb4c0d2600c32d8534a3868
Signed-off-by: Maya Erez <merez@codeaurora.org>
This commit is contained in:
Maya Erez 2015-09-21 14:43:38 +03:00 committed by Subhash Jadavani
parent 21a32a7af8
commit a93e005ce5

View file

@ -3431,14 +3431,27 @@ static int mmc_blk_cmdq_issue_rq(struct mmc_queue *mq, struct request *req)
unsigned int cmd_flags = req ? req->cmd_flags : 0; unsigned int cmd_flags = req ? req->cmd_flags : 0;
mmc_get_card(card); mmc_get_card(card);
if (!card->host->cmdq_ctx.active_reqs && mmc_card_doing_bkops(card)) {
ret = mmc_cmdq_halt(card->host, true);
if (ret)
goto out;
ret = mmc_stop_bkops(card);
if (ret) {
pr_err("%s: %s: mmc_stop_bkops failed %d\n",
md->disk->disk_name, __func__, ret);
goto out;
}
ret = mmc_cmdq_halt(card->host, false);
if (ret)
goto out;
}
ret = mmc_blk_cmdq_part_switch(card, md); ret = mmc_blk_cmdq_part_switch(card, md);
if (ret) { if (ret) {
pr_err("%s: %s: partition switch failed %d\n", pr_err("%s: %s: partition switch failed %d\n",
md->disk->disk_name, __func__, ret); md->disk->disk_name, __func__, ret);
if (req) goto out;
blk_end_request_all(req, ret);
mmc_put_card(card);
goto switch_failure;
} }
if (req) { if (req) {
@ -3455,7 +3468,13 @@ static int mmc_blk_cmdq_issue_rq(struct mmc_queue *mq, struct request *req)
} }
} }
switch_failure: return ret;
out:
if (req)
blk_end_request_all(req, ret);
mmc_put_card(card);
return ret; return ret;
} }