From: Konstantin Dorfman <kdorfman@codeaurora.org>
To: Seungwon Jeon <tgih.jun@samsung.com>
Cc: linux-mmc@vger.kernel.org, 'Chris Ball' <cjb@laptop.org>,
'Per Forlin' <per.forlin@linaro.org>
Subject: Re: [PATCH] mmc: queue: exclude asynchronous transfer for special request
Date: Thu, 20 Dec 2012 16:52:47 +0200 [thread overview]
Message-ID: <50D3263F.6050407@codeaurora.org> (raw)
In-Reply-To: <003c01cdde9c$95883ad0$c098b070$%jun@samsung.com>
Hello Jeon,
On 12/20/2012 12:27 PM, Seungwon Jeon wrote:
> 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>
> ---
> drivers/mmc/card/queue.c | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
> index fadf52e..a71db7a 100644
> --- a/drivers/mmc/card/queue.c
> +++ b/drivers/mmc/card/queue.c
> @@ -58,6 +58,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 +68,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 & REQ_DISCARD || cmd_flags & REQ_FLUSH)
> + mq->mqrq_cur->req = NULL;
> +
> mq->mqrq_prev->brq.mrq.data = NULL;
> mq->mqrq_prev->req = NULL;
> tmp = mq->mqrq_prev;
>
It is better to define control mask, REQ_CONTROL_MASK, which will
include all control/special requests.
Then, when additional request will be added, there will be no need to
change here, only update the mask.
Another option - to clean mq->mqrq_cur->req immediately after executing
a special request in mmc_blk_issue_rq().
--
Konstantin Dorfman,
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center,
Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
next prev parent reply other threads:[~2012-12-20 14:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-20 10:27 [PATCH] mmc: queue: exclude asynchronous transfer for special request Seungwon Jeon
2012-12-20 14:44 ` Konstantin Dorfman
2012-12-20 14:52 ` Konstantin Dorfman [this message]
2012-12-21 5:36 ` Seungwon Jeon
2012-12-22 10:56 ` Konstantin Dorfman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50D3263F.6050407@codeaurora.org \
--to=kdorfman@codeaurora.org \
--cc=cjb@laptop.org \
--cc=linux-mmc@vger.kernel.org \
--cc=per.forlin@linaro.org \
--cc=tgih.jun@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).