diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2017-03-13 14:36:35 +0200 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2017-04-24 21:42:00 +0200 |
commit | cdf8a6fb48882651049e468e6b16956fb83db86c (patch) | |
tree | 4637e5764e797b5e97b3327433b4c9d9d2927405 /drivers/mmc/core/queue.h | |
parent | 8ddfe07e18c9c82f7567d3cfbd68d8b59764d015 (diff) | |
download | linux-cdf8a6fb48882651049e468e6b16956fb83db86c.tar.gz linux-cdf8a6fb48882651049e468e6b16956fb83db86c.tar.bz2 linux-cdf8a6fb48882651049e468e6b16956fb83db86c.zip |
mmc: block: Introduce queue semantics
Change from viewing the requests in progress as 'current' and 'previous',
to viewing them as a queue. The current request is allocated to the first
free slot. The presence of incomplete requests is determined from the
count (mq->qcnt) of entries in the queue. Non-read-write requests (i.e.
discards and flushes) are not added to the queue at all and require no
special handling. Also no special handling is needed for the
MMC_BLK_NEW_REQUEST case.
As well as allowing an arbitrarily sized queue, the queue thread function
is significantly simpler.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core/queue.h')
-rw-r--r-- | drivers/mmc/core/queue.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mmc/core/queue.h b/drivers/mmc/core/queue.h index e298f100101b..967808df45b8 100644 --- a/drivers/mmc/core/queue.h +++ b/drivers/mmc/core/queue.h @@ -34,21 +34,21 @@ struct mmc_queue_req { struct scatterlist *bounce_sg; unsigned int bounce_sg_len; struct mmc_async_req areq; + int task_id; }; struct mmc_queue { struct mmc_card *card; struct task_struct *thread; struct semaphore thread_sem; - bool new_request; bool suspended; bool asleep; struct mmc_blk_data *blkdata; struct request_queue *queue; struct mmc_queue_req *mqrq; - struct mmc_queue_req *mqrq_cur; - struct mmc_queue_req *mqrq_prev; int qdepth; + int qcnt; + unsigned long qslots; }; extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *, @@ -64,4 +64,8 @@ extern void mmc_queue_bounce_post(struct mmc_queue_req *); extern int mmc_access_rpmb(struct mmc_queue *); +extern struct mmc_queue_req *mmc_queue_req_find(struct mmc_queue *, + struct request *); +extern void mmc_queue_req_free(struct mmc_queue *, struct mmc_queue_req *); + #endif |