mmc: queue: Share mmc request array between partitions

eMMC can have multiple internal partitions that are represented as separate
disks / queues. However switching between partitions is only done when the
queue is empty. Consequently the array of mmc requests that are queued can
be shared between partitions saving memory.

Keep a pointer to the mmc request queue on the card, and use that instead
of allocating a new one for each partition.

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>
This commit is contained in:
Adrian Hunter 2017-03-13 14:36:36 +02:00 committed by Ulf Hansson
parent cdf8a6fb48
commit 7b410d074b
4 changed files with 159 additions and 99 deletions

View file

@ -208,6 +208,7 @@ struct sdio_cis {
struct mmc_host;
struct sdio_func;
struct sdio_func_tuple;
struct mmc_queue_req;
#define SDIO_MAX_FUNCS 7
@ -300,6 +301,10 @@ struct mmc_card {
struct dentry *debugfs_root;
struct mmc_part part[MMC_NUM_PHY_PARTITION]; /* physical partitions */
unsigned int nr_parts;
struct mmc_queue_req *mqrq; /* Shared queue structure */
unsigned int bouncesz; /* Bounce buffer size */
int qdepth; /* Shared queue depth */
};
static inline bool mmc_large_sector(struct mmc_card *card)