summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaya Erez <merez@codeaurora.org>2015-10-01 11:27:17 +0300
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:27:34 -0700
commitbaf5c81221e569365ea58ddee370a68a503fe4e9 (patch)
tree9c48930cac2413220a6cf5fd5d986decee1a1a4e
parentf0b1bca2eba1429fa0a89561f5e7fd7d20e8e568 (diff)
mmc: block: stop BKOPs before handling RPMB and ioctl
IOCTL and RPMB commands can be issued while the device is busy with background Operations handling. Stop the device BKOPs before handling the RPMB / IOCTL command. Change-Id: I088f74c77026ccd901276e1214e4466ac7815bf1 Signed-off-by: Maya Erez <merez@codeaurora.org> [subhashj@codeaurora.org: fixed merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
-rw-r--r--drivers/mmc/card/block.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 1008b6247288..5c554c882f29 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -670,6 +670,15 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
mrq.cmd = &cmd;
+ if (mmc_card_doing_bkops(card)) {
+ err = mmc_stop_bkops(card);
+ if (err) {
+ dev_err(mmc_dev(card->host),
+ "%s: stop_bkops failed %d\n", __func__, err);
+ return err;
+ }
+ }
+
err = mmc_blk_part_switch(card, md);
if (err)
return err;
@@ -790,6 +799,25 @@ static int mmc_blk_ioctl_rpmb_cmd(struct block_device *bdev,
mmc_get_card(card);
+ if (mmc_card_doing_bkops(card)) {
+ if (mmc_card_cmdq(card)) {
+ err = mmc_cmdq_halt(card->host, true);
+ if (err)
+ goto cmd_rel_host;
+ }
+ err = mmc_stop_bkops(card);
+ if (err) {
+ dev_err(mmc_dev(card->host),
+ "%s: stop_bkops failed %d\n", __func__, err);
+ goto cmd_rel_host;
+ }
+ if (mmc_card_cmdq(card)) {
+ err = mmc_cmdq_halt(card->host, false);
+ if (err)
+ goto cmd_rel_host;
+ }
+ }
+
err = mmc_blk_part_switch(card, md);
if (err)
goto cmd_rel_host;