Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1737458 > unrolled thread

[PATCH V9 04/15] mmc: mmc: Enable Command Queuing

Started byAdrian Hunter <adrian.hunter@intel.com>
First post2017-09-22 14:50 +0200
Last post2017-09-26 17:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH V9 04/15] mmc: mmc: Enable Command Queuing Adrian Hunter <adrian.hunter@intel.com> - 2017-09-22 14:50 +0200
    Re: [PATCH V9 04/15] mmc: mmc: Enable Command Queuing Linus Walleij <linus.walleij@linaro.org> - 2017-09-26 17:40 +0200

#1737458 — [PATCH V9 04/15] mmc: mmc: Enable Command Queuing

FromAdrian Hunter <adrian.hunter@intel.com>
Date2017-09-22 14:50 +0200
Subject[PATCH V9 04/15] mmc: mmc: Enable Command Queuing
Message-ID<usvz3-68T-5@gated-at.bofh.it>
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>
---
 drivers/mmc/core/mmc.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 3927157207b9..454a5079a90f 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1784,6 +1784,23 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 	}
 
 	/*
+	 * Enable Command Queue if supported. Note that Packed Commands cannot
+	 * be used with Command Queue.
+	 */
+	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;
+		}
+	}
+	/*
 	 * In some cases (e.g. RPMB or mmc_test), the Command Queue must be
 	 * disabled for a time, so a flag is needed to indicate to re-enable the
 	 * Command Queue.
-- 
1.9.1

[toc] | [next] | [standalone]


#1739992

FromLinus Walleij <linus.walleij@linaro.org>
Date2017-09-26 17:40 +0200
Message-ID<uu07O-6zu-37@gated-at.bofh.it>
In reply to#1737458
On Fri, Sep 22, 2017 at 2:36 PM, Adrian Hunter <adrian.hunter@intel.com> wrote:

> 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>

Yours,
Linus Walleij

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web