diff options
author | Seungwon Jeon <tgih.jun@samsung.com> | 2012-09-28 06:12:53 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-12-06 13:54:37 -0500 |
commit | 45c5a914e68fdbbc2635c3cc197566aa24e8de5b (patch) | |
tree | ed3c0d93646ef19f712211425149611e3c4091b0 | |
parent | 42cd95a0603e0497e7221816bb5ddfe861ee9325 (diff) |
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>
-rw-r--r-- | drivers/mmc/card/queue.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index e360a979857d..fadf52eb5d70 100644 --- a/drivers/mmc/card/queue.c +++ b/drivers/mmc/card/queue.c | |||
@@ -68,6 +68,16 @@ static int mmc_queue_thread(void *d) | |||
68 | if (req || mq->mqrq_prev->req) { | 68 | if (req || mq->mqrq_prev->req) { |
69 | set_current_state(TASK_RUNNING); | 69 | set_current_state(TASK_RUNNING); |
70 | mq->issue_fn(mq, req); | 70 | mq->issue_fn(mq, req); |
71 | |||
72 | /* | ||
73 | * Current request becomes previous request | ||
74 | * and vice versa. | ||
75 | */ | ||
76 | mq->mqrq_prev->brq.mrq.data = NULL; | ||
77 | mq->mqrq_prev->req = NULL; | ||
78 | tmp = mq->mqrq_prev; | ||
79 | mq->mqrq_prev = mq->mqrq_cur; | ||
80 | mq->mqrq_cur = tmp; | ||
71 | } else { | 81 | } else { |
72 | if (kthread_should_stop()) { | 82 | if (kthread_should_stop()) { |
73 | set_current_state(TASK_RUNNING); | 83 | set_current_state(TASK_RUNNING); |
@@ -77,13 +87,6 @@ static int mmc_queue_thread(void *d) | |||
77 | schedule(); | 87 | schedule(); |
78 | down(&mq->thread_sem); | 88 | down(&mq->thread_sem); |
79 | } | 89 | } |
80 | |||
81 | /* Current request becomes previous request and vice versa. */ | ||
82 | mq->mqrq_prev->brq.mrq.data = NULL; | ||
83 | mq->mqrq_prev->req = NULL; | ||
84 | tmp = mq->mqrq_prev; | ||
85 | mq->mqrq_prev = mq->mqrq_cur; | ||
86 | mq->mqrq_cur = tmp; | ||
87 | } while (1); | 90 | } while (1); |
88 | up(&mq->thread_sem); | 91 | up(&mq->thread_sem); |
89 | 92 | ||