From: Chris Ball <cjb@laptop.org>
To: Seungwon Jeon <tgih.jun@samsung.com>
Cc: linux-mmc@vger.kernel.org, 'Per Forlin' <per.forlin@linaro.org>
Subject: Re: mmc: queue: amend buffer swap for non-blocking transfer
Date: Tue, 23 Oct 2012 17:01:46 -0400 [thread overview]
Message-ID: <877gqgj41x.fsf@octavius.laptop.org> (raw)
In-Reply-To: <00fe01cd9d61$d2f6f180$78e4d480$%jun@samsung.com> (Seungwon Jeon's message of "Fri, 28 Sep 2012 19:12:53 +0900")
Hi,
On Fri, Sep 28 2012, Seungwon Jeon wrote:
> 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>
> ---
> 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 e360a97..fadf52e 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);
Thanks, pushed to mmc-next for 3.8.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
prev parent reply other threads:[~2012-10-23 21:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-28 10:12 mmc: queue: amend buffer swap for non-blocking transfer Seungwon Jeon
2012-09-28 11:28 ` Per Forlin
2012-09-28 11:31 ` Johan Rudholm
2012-10-23 21:01 ` Chris Ball [this message]
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=877gqgj41x.fsf@octavius.laptop.org \
--to=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