Skip to content

Commit 98d4f78

Browse files
ahunter6storulf
authored andcommitted
mmc: mmc: Enable Command Queuing
Enable the Command Queue if the host controller supports a command queue engine. It is not compatible with Packed Commands, so make a note of that in the comment. 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>
1 parent 72a5af5 commit 98d4f78

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

drivers/mmc/core/mmc.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,6 +1785,23 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
17851785
}
17861786
}
17871787

1788+
/*
1789+
* Enable Command Queue if supported. Note that Packed Commands cannot
1790+
* be used with Command Queue.
1791+
*/
1792+
card->ext_csd.cmdq_en = false;
1793+
if (card->ext_csd.cmdq_support && host->caps2 & MMC_CAP2_CQE) {
1794+
err = mmc_cmdq_enable(card);
1795+
if (err && err != -EBADMSG)
1796+
goto free_card;
1797+
if (err) {
1798+
pr_warn("%s: Enabling CMDQ failed\n",
1799+
mmc_hostname(card->host));
1800+
card->ext_csd.cmdq_support = false;
1801+
card->ext_csd.cmdq_depth = 0;
1802+
err = 0;
1803+
}
1804+
}
17881805
/*
17891806
* In some cases (e.g. RPMB or mmc_test), the Command Queue must be
17901807
* disabled for a time, so a flag is needed to indicate to re-enable the

0 commit comments

Comments
 (0)