summaryrefslogtreecommitdiff
path: root/drivers/mmc/card/block.c
diff options
context:
space:
mode:
authorDov Levenglick <dovl@codeaurora.org>2015-06-24 19:51:58 +0300
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:26:49 -0700
commitfda56078bbf3b05a9bb1c2ffe3d3616dd15714d5 (patch)
tree1baf3fcd0d9f512dc5dc6b7b889cc3cabd935c2b /drivers/mmc/card/block.c
parent37927a22fe1c03a9ec3f410af4ffae1707330918 (diff)
mmc: add support for bkops
Add support for manual and auto bkops for legacy (not command-queue) mode. Change-Id: I1333e1d4330393e446ba48a9474c83295744c050 Signed-off-by: Dov Levenglick <dovl@codeaurora.org> [subhashj@codeaurora.org: fixed merge conflicts and compilation errors] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Diffstat (limited to 'drivers/mmc/card/block.c')
-rw-r--r--drivers/mmc/card/block.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 5d95402c5fb2..006d112f11db 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -43,6 +43,7 @@
#include <linux/mmc/ioctl.h>
#include <linux/mmc/card.h>
+#include <linux/mmc/core.h>
#include <linux/mmc/host.h>
#include <linux/mmc/mmc.h>
#include <linux/mmc/sd.h>
@@ -3405,10 +3406,17 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
unsigned long flags;
unsigned int cmd_flags = req ? req->cmd_flags : 0;
- if (req && !mq->mqrq_prev->req)
+ if (req && !mq->mqrq_prev->req) {
/* claim host only for the first request */
mmc_get_card(card);
+ if (mmc_card_doing_bkops(host->card)) {
+ ret = mmc_stop_bkops(host->card);
+ if (ret)
+ goto out;
+ }
+ }
+
ret = mmc_blk_part_switch(card, md);
if (ret) {
if (req) {
@@ -3951,8 +3959,16 @@ static int mmc_blk_probe(struct mmc_card *card)
goto out;
}
- pm_runtime_set_autosuspend_delay(&card->dev, 3000);
pm_runtime_use_autosuspend(&card->dev);
+ pm_runtime_set_autosuspend_delay(&card->dev, MMC_AUTOSUSPEND_DELAY_MS);
+ /*
+ * If there is a runtime_idle function, it should take care of
+ * suspending the card
+ */
+ if (card->host->bus_ops->runtime_idle)
+ pm_runtime_dont_use_autosuspend(&card->dev);
+ else
+ pm_runtime_use_autosuspend(&card->dev);
/*
* Don't enable runtime PM for SD-combo cards here. Leave that