Commit 369d321e authored by Seungwon Jeon's avatar Seungwon Jeon Committed by Chris Ball

mmc: queue: exclude asynchronous transfer for special request

Unlike normal r/w request, special requests(discard, flush)
is finished with a one-time issue_fn. Request change to
mqrq_prev makes unnecessary call.
Signed-off-by: default avatarSeungwon Jeon <tgih.jun@samsung.com>
Reviewed-by: default avatarKonstantin Dorfman <kdorfman@codeaurora.org>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 8af50750
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#define MMC_QUEUE_SUSPENDED (1 << 0) #define MMC_QUEUE_SUSPENDED (1 << 0)
#define MMC_REQ_SPECIAL_MASK (REQ_DISCARD | REQ_FLUSH)
/* /*
* Prepare a MMC request. This just filters out odd stuff. * Prepare a MMC request. This just filters out odd stuff.
*/ */
...@@ -58,6 +60,7 @@ static int mmc_queue_thread(void *d) ...@@ -58,6 +60,7 @@ static int mmc_queue_thread(void *d)
do { do {
struct request *req = NULL; struct request *req = NULL;
struct mmc_queue_req *tmp; struct mmc_queue_req *tmp;
unsigned int cmd_flags = 0;
spin_lock_irq(q->queue_lock); spin_lock_irq(q->queue_lock);
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
...@@ -67,12 +70,19 @@ static int mmc_queue_thread(void *d) ...@@ -67,12 +70,19 @@ static int mmc_queue_thread(void *d)
if (req || mq->mqrq_prev->req) { if (req || mq->mqrq_prev->req) {
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
cmd_flags = req ? req->cmd_flags : 0;
mq->issue_fn(mq, req); mq->issue_fn(mq, req);
/* /*
* Current request becomes previous request * Current request becomes previous request
* and vice versa. * and vice versa.
* In case of special requests, current request
* has been finished. Do not assign it to previous
* request.
*/ */
if (cmd_flags & MMC_REQ_SPECIAL_MASK)
mq->mqrq_cur->req = NULL;
mq->mqrq_prev->brq.mrq.data = NULL; mq->mqrq_prev->brq.mrq.data = NULL;
mq->mqrq_prev->req = NULL; mq->mqrq_prev->req = NULL;
tmp = mq->mqrq_prev; tmp = mq->mqrq_prev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment