diff options
-rw-r--r-- | drivers/mmc/card/block.c | 7 | ||||
-rw-r--r-- | drivers/mmc/card/queue.c | 6 |
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; |