From 88412bf3be9ff7bd3e3159bbb36b9722caf746f5 Mon Sep 17 00:00:00 2001 From: Jianqun Xu Date: Wed, 23 Feb 2022 13:13:16 +0800 Subject: [PATCH] mmc: core: make the mmc queue depth configurable This patch make driver able to set the queue depth and keep the default vaule to be '64'. Change-Id: I54cd065d6536c170d1615a6f9d7071d479bfeb84 Signed-off-by: Jianqun Xu --- drivers/mmc/core/Kconfig | 11 +++++++++++ drivers/mmc/core/queue.c | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/drivers/mmc/core/Kconfig b/drivers/mmc/core/Kconfig index ae8b69aee619..a3b684491f1e 100644 --- a/drivers/mmc/core/Kconfig +++ b/drivers/mmc/core/Kconfig @@ -89,3 +89,14 @@ config MMC_CRYPTO Enabling this makes it possible for the kernel to use the crypto capabilities of the MMC device (if present) to perform crypto operations on data being transferred to/from the device. + +config MMC_QUEUE_DEPTH + int "MMC Queue Depth number" + range 1 64 + depends on ROCKCHIP_MINI_KERNEL + default 64 + help + Set a depth num for mmc queue, user can set it lower to decrease + queue number to save memory, suggest set to NR_CPUS. + + If unsure, say 64 here. diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c index c817f6decd6a..c4db326636b4 100644 --- a/drivers/mmc/core/queue.c +++ b/drivers/mmc/core/queue.c @@ -419,7 +419,11 @@ static inline bool mmc_merge_capable(struct mmc_host *host) } /* Set queue depth to get a reasonable value for q->nr_requests */ +#ifdef CONFIG_MMC_QUEUE_DEPTH +#define MMC_QUEUE_DEPTH CONFIG_MMC_QUEUE_DEPTH +#else #define MMC_QUEUE_DEPTH 64 +#endif /** * mmc_init_queue - initialise a queue structure.