mmc: block: Introduce queue semantics
authorAdrian Hunter <adrian.hunter@intel.com>
Mon, 13 Mar 2017 12:36:35 +0000 (14:36 +0200)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:37:10 +0000 (15:37 -0500)
commita011881bb71f720d001c9a49715358e0bdc7b995
treec547e624cc2657dd1f4373d5022fb4e540b79b18
parent53ac76970fc8b982e4f4c4516040faf599cb36fc
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>
(cherry picked from commit cdf8a6fb48882651049e468e6b16956fb83db86c)
drivers/mmc/core/block.c
drivers/mmc/core/queue.c
drivers/mmc/core/queue.h