mmc: queue: exclude asynchronous transfer for special request
PATCH v2 1/1 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 <[email protected]>
--- drivers/mmc/card/queue.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
drivers/mmc/card/queue.c +10 -0
@@ -24,6 +24,8 @@#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. */
@@ -58,6 +60,7 @@ static int mmc_queue_thread(void *d) do { struct request *req = NULL; struct mmc_queue_req *tmp; + unsigned int cmd_flags = 0; spin_lock_irq(q->queue_lock); set_current_state(TASK_INTERRUPTIBLE);
@@ -67,12 +70,19 @@ static int mmc_queue_thread(void *d)if (req || mq->mqrq_prev->req) {set_current_state (TASK_RUNNING ); + cmd_flags = req ? req->cmd_flags :0 ; mq->issue_fn (mq, req);/* * Current request becomes previous request * and vice versa. +* In case of special requests, current request +* has been finished. Do not remain 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->req =NULL ; tmp = mq->mqrq_prev;
Signature · 1 line
1.7.0.4
Reviewed-by Konstantin Dorfman <[email protected]>
Quoted 51 lines · Seungwon Jeon
Unlike normal r/w request, special
requests(discard, flush)is finished with a one-timeissue_fn. Request change tomqrq_prevmakes unnecessary call.Signed-off-by Seungwon Jeon <[email protected]>--- drivers/mmc/card/queue.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)drivers/mmc/card/queue.c +10
-0@@ -24,6 +24,8 @@#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. */ @@ -58,6 +60,7 @@ static int mmc_queue_thread(void *d) do { struct request *req = NULL; struct mmc_queue_req *tmp; + unsigned int cmd_flags = 0; spin_lock_irq(q->queue_lock); set_current_state(TASK_INTERRUPTIBLE);@@ -67,12 +70,19 @@ static int mmc_queue_thread(void *d)if (req || mq->mqrq_prev->req) {set_current_state (TASK_RUNNING ); + cmd_flags = req ? req->cmd_flags :0 ; mq->issue_fn (mq, req);/* * Current request becomes previous request * and vice versa. +* In case of special requests, current request +* has been finished. Do not remain 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->req =NULL ; tmp = mq->mqrq_prev;
Signature · 4 lines
Konstantin Dorfman, QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Hi,
Quoted 8 lines · Konstantin Dorfman
Reviewed-by Konstantin Dorfman <[email protected]>Quoted 5 lines · Seungwon Jeon
Unlike normal r/w request, special
requests(discard, flush)is finished with a one-timeissue_fn. Request change tomqrq_prevmakes unnecessary call.Signed-off-by Seungwon Jeon <[email protected]>
Thanks, pushed to mmc-next for 3.9.
- Chris.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child