Skip to content

Commit f690f44

Browse files
ahunter6storulf
authored andcommitted
mmc: mmc: Enable CQE's
Enable or disable CQE when a card is added or removed respectively. 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 98d4f78 commit f690f44

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

drivers/mmc/core/bus.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,17 @@ int mmc_add_card(struct mmc_card *card)
369369
*/
370370
void mmc_remove_card(struct mmc_card *card)
371371
{
372+
struct mmc_host *host = card->host;
373+
372374
#ifdef CONFIG_DEBUG_FS
373375
mmc_remove_card_debugfs(card);
374376
#endif
375377

378+
if (host->cqe_enabled) {
379+
host->cqe_ops->cqe_disable(host);
380+
host->cqe_enabled = false;
381+
}
382+
376383
if (mmc_card_present(card)) {
377384
if (mmc_host_is_spi(card->host)) {
378385
pr_info("%s: SPI card removed\n",

drivers/mmc/core/mmc.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,6 +1809,18 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
18091809
*/
18101810
card->reenable_cmdq = card->ext_csd.cmdq_en;
18111811

1812+
if (card->ext_csd.cmdq_en && !host->cqe_enabled) {
1813+
err = host->cqe_ops->cqe_enable(host, card);
1814+
if (err) {
1815+
pr_err("%s: Failed to enable CQE, error %d\n",
1816+
mmc_hostname(host), err);
1817+
} else {
1818+
host->cqe_enabled = true;
1819+
pr_info("%s: Command Queue Engine enabled\n",
1820+
mmc_hostname(host));
1821+
}
1822+
}
1823+
18121824
if (!oldcard)
18131825
host->card = card;
18141826

0 commit comments

Comments
 (0)