summaryrefslogtreecommitdiff
path: root/drivers/mmc/card
diff options
context:
space:
mode:
authorShridhar Rasal <srasal@nvidia.com>2012-01-25 18:49:32 +0530
committerSimone Willett <swillett@nvidia.com>2012-02-10 13:12:23 -0800
commitb4a02aa8aaf1ce825f4b7b44851e7e7b6deeaec4 (patch)
tree8c9d5a6f7445d1ddafd9295310eb890e07a42f9f /drivers/mmc/card
parent506e63fcfb563581c4a0417d424e36a75cf51acf (diff)
mmc: card: Issue BKOPS when queue is empty
Issue BKOPS when the request queue is empty. Before handling any new request, issue HPI if bkops is being performed. bug 919232 Originally reviewed on http://git-master/r/69779 Change-Id: Ic9258ebfea7f9cde96525371a5ef9d6d003ebf2f Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com> Signed-off-by: Shridhar Rasal <srasal@nvidia.com> Reviewed-on: http://git-master/r/77335 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'drivers/mmc/card')
-rw-r--r--drivers/mmc/card/block.c7
-rw-r--r--drivers/mmc/card/queue.c6
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 6db913d6342f..2bd93d7a5170 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1140,6 +1140,9 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
}
} while (ret);
+ if (brq->cmd.resp[0] & R1_URGENT_BKOPS)
+ mmc_card_set_need_bkops(card);
+
return 1;
cmd_err:
@@ -1221,6 +1224,10 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
mmc_blk_issue_rw_rq(mq, NULL);
ret = mmc_blk_issue_flush(mq, req);
} else {
+ /* Abort any current bk ops of eMMC card by issuing HPI */
+ if (mmc_card_mmc(mq->card) && mmc_card_doing_bkops(mq->card))
+ mmc_interrupt_hpi(mq->card);
+
ret = mmc_blk_issue_rw_rq(mq, req);
}
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index 45fb362e3f01..5db38cbcea6d 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -64,6 +64,12 @@ static int mmc_queue_thread(void *d)
set_current_state(TASK_RUNNING);
mq->issue_fn(mq, req);
} else {
+ /*
+ * Since the queue is empty, start synchronous
+ * background ops if there is a request for it.
+ */
+ if (mmc_card_need_bkops(mq->card))
+ mmc_bkops_start(mq->card, true);
if (kthread_should_stop()) {
set_current_state(TASK_RUNNING);
break;