summaryrefslogtreecommitdiff
path: root/drivers/mmc/card
diff options
context:
space:
mode:
authorSeungwon Jeon <tgih.jun@samsung.com>2012-09-28 19:12:53 +0900
committerChris Ball <cjb@laptop.org>2012-12-06 13:54:37 -0500
commit45c5a914e68fdbbc2635c3cc197566aa24e8de5b (patch)
treeed3c0d93646ef19f712211425149611e3c4091b0 /drivers/mmc/card
parent42cd95a0603e0497e7221816bb5ddfe861ee9325 (diff)
downloadlinux-3.10-45c5a914e68fdbbc2635c3cc197566aa24e8de5b.tar.gz
linux-3.10-45c5a914e68fdbbc2635c3cc197566aa24e8de5b.tar.bz2
linux-3.10-45c5a914e68fdbbc2635c3cc197566aa24e8de5b.zip
mmc: queue: amend buffer swap for non-blocking transfer
In case both 'req' and 'mq->mqrq_prev->req' are null, there is no request to be processed. That means there is no need to switch buffer. Switching buffer is required only after finishing 'issue_fn'. Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com> Reviewed-by: Per Forlin <per.forlin@stericsson.com> Tested-by: Johan Rudholm <johan.rudholm@stericsson.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/card')
-rw-r--r--drivers/mmc/card/queue.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index e360a979857..fadf52eb5d7 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -68,6 +68,16 @@ static int mmc_queue_thread(void *d)
if (req || mq->mqrq_prev->req) {
set_current_state(TASK_RUNNING);
mq->issue_fn(mq, req);
+
+ /*
+ * Current request becomes previous request
+ * and vice versa.
+ */
+ mq->mqrq_prev->brq.mrq.data = NULL;
+ mq->mqrq_prev->req = NULL;
+ tmp = mq->mqrq_prev;
+ mq->mqrq_prev = mq->mqrq_cur;
+ mq->mqrq_cur = tmp;
} else {
if (kthread_should_stop()) {
set_current_state(TASK_RUNNING);
@@ -77,13 +87,6 @@ static int mmc_queue_thread(void *d)
schedule();
down(&mq->thread_sem);
}
-
- /* Current request becomes previous request and vice versa. */
- mq->mqrq_prev->brq.mrq.data = NULL;
- mq->mqrq_prev->req = NULL;
- tmp = mq->mqrq_prev;
- mq->mqrq_prev = mq->mqrq_cur;
- mq->mqrq_cur = tmp;
} while (1);
up(&mq->thread_sem);