Re: [PATCH v2 08/12] mmc: add handling for two parallel blockrequests in issue_rw_rq

From: Per Forlin
Date: Wed Apr 20 2011 - 07:32:24 EST


On 6 April 2011 21:07, Per Forlin <per.forlin@xxxxxxxxxx> wrote:
> Change mmc_blk_issue_rw_rq() to become asynchronous.
> The execution flow looks like this:
> The mmc-queue calls issue_rw_rq(), which sends the request
> to the host and returns back to the mmc-queue. The mmc-queue calls
> isuue_rw_rq() again with a new request. This new request is prepared,
> in isuue_rw_rq(), then it waits for the active request to complete before
> pushing it to the host. When to mmc-queue is empty it will call
> isuue_rw_rq() with req=NULL to finish off the active request
> without starting a new request.
>
> Signed-off-by: Per Forlin <per.forlin@xxxxxxxxxx>
> ---
>  drivers/mmc/card/block.c |  157 +++++++++++++++++++++++++++++++++++++++-------
>  drivers/mmc/card/queue.c |    2 +-
>  2 files changed, 134 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
> index eef3510..2b14d1c 100644
> --- a/drivers/mmc/card/queue.c
> +++ b/drivers/mmc/card/queue.c
> @@ -59,6 +59,7 @@ static int mmc_queue_thread(void *d)
>                mq->mqrq_cur->req = req;
>                spin_unlock_irq(q->queue_lock);
>
Call set_current_state(TASK_RUNNING) before issue_fn() otherwise
issue_fn will execute as TASK_INTERRUPTIBLE.
Will be added in the version 3 of this patchset.

> + mq->issue_fn(mq, req);
>                if (!req) {
>                        if (kthread_should_stop()) {
>                                set_current_state(TASK_RUNNING);
> @@ -71,7 +72,6 @@ static int mmc_queue_thread(void *d)
>                }
>                set_current_state(TASK_RUNNING);
>
> -               mq->issue_fn(mq, req);
>        } while (1);
>        up(&mq->thread_sem);
>
> --
> 1.7.4.1
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/