diff options
author | Seungwon Jeon <tgih.jun@samsung.com> | 2012-12-25 20:40:17 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-02-11 13:28:48 -0500 |
commit | 369d321ed1baa7748e770aaaae4d8effad699633 (patch) | |
tree | 7aae0b0a3e77dda2c5966cb0fd39d9883c77ec3a /drivers | |
parent | 8af5075088a0aaa64caed5ed212b485b5760bf0b (diff) |
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: Seungwon Jeon <tgih.jun@samsung.com>
Reviewed-by: Konstantin Dorfman <kdorfman@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/card/queue.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index fadf52eb5d70..d630d9861e7b 100644 --- a/drivers/mmc/card/queue.c +++ b/drivers/mmc/card/queue.c | |||
@@ -24,6 +24,8 @@ | |||
24 | 24 | ||
25 | #define MMC_QUEUE_SUSPENDED (1 << 0) | 25 | #define MMC_QUEUE_SUSPENDED (1 << 0) |
26 | 26 | ||
27 | #define MMC_REQ_SPECIAL_MASK (REQ_DISCARD | REQ_FLUSH) | ||
28 | |||
27 | /* | 29 | /* |
28 | * Prepare a MMC request. This just filters out odd stuff. | 30 | * Prepare a MMC request. This just filters out odd stuff. |
29 | */ | 31 | */ |
@@ -58,6 +60,7 @@ static int mmc_queue_thread(void *d) | |||
58 | do { | 60 | do { |
59 | struct request *req = NULL; | 61 | struct request *req = NULL; |
60 | struct mmc_queue_req *tmp; | 62 | struct mmc_queue_req *tmp; |
63 | unsigned int cmd_flags = 0; | ||
61 | 64 | ||
62 | spin_lock_irq(q->queue_lock); | 65 | spin_lock_irq(q->queue_lock); |
63 | set_current_state(TASK_INTERRUPTIBLE); | 66 | set_current_state(TASK_INTERRUPTIBLE); |
@@ -67,12 +70,19 @@ static int mmc_queue_thread(void *d) | |||
67 | 70 | ||
68 | if (req || mq->mqrq_prev->req) { | 71 | if (req || mq->mqrq_prev->req) { |
69 | set_current_state(TASK_RUNNING); | 72 | set_current_state(TASK_RUNNING); |
73 | cmd_flags = req ? req->cmd_flags : 0; | ||
70 | mq->issue_fn(mq, req); | 74 | mq->issue_fn(mq, req); |
71 | 75 | ||
72 | /* | 76 | /* |
73 | * Current request becomes previous request | 77 | * Current request becomes previous request |
74 | * and vice versa. | 78 | * and vice versa. |
79 | * In case of special requests, current request | ||
80 | * has been finished. Do not assign it to previous | ||
81 | * request. | ||
75 | */ | 82 | */ |
83 | if (cmd_flags & MMC_REQ_SPECIAL_MASK) | ||
84 | mq->mqrq_cur->req = NULL; | ||
85 | |||
76 | mq->mqrq_prev->brq.mrq.data = NULL; | 86 | mq->mqrq_prev->brq.mrq.data = NULL; |
77 | mq->mqrq_prev->req = NULL; | 87 | mq->mqrq_prev->req = NULL; |
78 | tmp = mq->mqrq_prev; | 88 | tmp = mq->mqrq_prev; |