diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index aefd358a5ca36b..e5c2b1566e8e13 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -2506,6 +2506,14 @@ log everything. Information is printed at KERN_DEBUG so loglevel=8 may also need to be specified. + mmc_cmdqueue= [MMC] + Enable or disable MMC command queue (CMDQ) support. When + enabled MMC driver will try to enable CMDQ for cards that + support it. When disabled CMDQ will not be enabled for any + card. + Format: (1/y/on=enable, 0/n/off=disable) + default: enabled + module.sig_enforce [KNL] When CONFIG_MODULE_SIG is set, this means that modules without (valid) signatures will fail to load. diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 55997cf84b39f5..2c69a7cbe8077c 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -9,7 +9,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - +#include #include #include #include @@ -65,6 +65,10 @@ static const unsigned int taac_mant[] = { __res & __mask; \ }) +/* Enable / disable command queue support */ +static bool mmc_cmdqueue_support = true; +core_param(mmc_cmdqueue, mmc_cmdqueue_support, bool, S_IRUGO); + /* * Given the decoded CSD structure, decode the raw CID to our CID structure. */ @@ -1824,15 +1828,20 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, */ card->ext_csd.cmdq_en = false; if (card->ext_csd.cmdq_support && host->caps2 & MMC_CAP2_CQE) { - err = mmc_cmdq_enable(card); - if (err && err != -EBADMSG) - goto free_card; - if (err) { - pr_warn("%s: Enabling CMDQ failed\n", - mmc_hostname(card->host)); - card->ext_csd.cmdq_support = false; - card->ext_csd.cmdq_depth = 0; - err = 0; + if (mmc_cmdqueue_support) { + err = mmc_cmdq_enable(card); + if (err && err != -EBADMSG) + goto free_card; + if (err) { + pr_warn("%s: Enabling CMDQ failed\n", + mmc_hostname(card->host)); + card->ext_csd.cmdq_support = false; + card->ext_csd.cmdq_depth = 0; + err = 0; + } + } else { + pr_info("%s: CMDQ support disabled in kernel\n", + mmc_hostname(host)); } } /*