All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc <linux-mmc@vger.kernel.org>,
	linux-block <linux-block@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Bough Chen <haibo.chen@nxp.com>,
	Alex Lemberg <alex.lemberg@sandisk.com>,
	Mateusz Nowak <mateusz.nowak@intel.com>,
	Yuliy Izrailov <Yuliy.Izrailov@sandisk.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Dong Aisheng <dongas86@gmail.com>,
	Das Asutosh <asutoshd@codeaurora.org>,
	Zhangfei Gao <zhangfei.gao@gmail.com>,
	Sahitya Tummala <stummala@codeaurora.org>,
	Harjani Ritesh <riteshh@codeaurora.org>,
	Venu Byravarasu <vbyravarasu@nvidia.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Shawn Lin <shawn.lin@rock-chips.com>,
	Christoph Hellwig <hch@lst.de>
Subject: [PATCH V8 06/14] mmc: block: Prepare CQE data
Date: Wed, 13 Sep 2017 14:40:06 +0300	[thread overview]
Message-ID: <1505302814-19313-7-git-send-email-adrian.hunter@intel.com> (raw)
In-Reply-To: <1505302814-19313-1-git-send-email-adrian.hunter@intel.com>

Enhance mmc_blk_data_prep() to support CQE requests. That means adding
some things that for non-CQE requests would be encoded into the command
arguments - such as the block address, reliable-write flag, and data tag
flag. Also the request tag is needed to provide the command queue task id,
and a comment is added to explain the future possibility of defining a
priority.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 drivers/mmc/core/block.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 1ec5f0bc98d2..2424c7360687 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -1554,6 +1554,7 @@ static void mmc_blk_data_prep(struct mmc_queue *mq, struct mmc_queue_req *mqrq,
 	memset(brq, 0, sizeof(struct mmc_blk_request));
 
 	brq->mrq.data = &brq->data;
+	brq->mrq.tag = req->tag;
 
 	brq->stop.opcode = MMC_STOP_TRANSMISSION;
 	brq->stop.arg = 0;
@@ -1568,6 +1569,14 @@ static void mmc_blk_data_prep(struct mmc_queue *mq, struct mmc_queue_req *mqrq,
 
 	brq->data.blksz = 512;
 	brq->data.blocks = blk_rq_sectors(req);
+	brq->data.blk_addr = blk_rq_pos(req);
+
+	/*
+	 * The command queue supports 2 priorities: "high" (1) and "simple" (0).
+	 * The eMMC will give "high" priority tasks priority over "simple"
+	 * priority tasks. Here we always set "simple" priority by not setting
+	 * MMC_DATA_PRIO.
+	 */
 
 	/*
 	 * The block layer doesn't support all sector count
@@ -1597,8 +1606,10 @@ static void mmc_blk_data_prep(struct mmc_queue *mq, struct mmc_queue_req *mqrq,
 						brq->data.blocks);
 	}
 
-	if (do_rel_wr)
+	if (do_rel_wr) {
 		mmc_apply_rel_rw(brq, card, req);
+		brq->data.flags |= MMC_DATA_REL_WR;
+	}
 
 	/*
 	 * Data tag is used only during writing meta data to speed
@@ -1610,6 +1621,9 @@ static void mmc_blk_data_prep(struct mmc_queue *mq, struct mmc_queue_req *mqrq,
 		      ((brq->data.blocks * brq->data.blksz) >=
 		       card->ext_csd.data_tag_unit_size);
 
+	if (do_data_tag)
+		brq->data.flags |= MMC_DATA_DAT_TAG;
+
 	mmc_set_data_timeout(&brq->data, card);
 
 	brq->data.sg = mqrq->sg;
-- 
1.9.1

  parent reply	other threads:[~2017-09-13 11:47 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-13 11:40 [PATCH V8 00/14] mmc: Add Command Queue support Adrian Hunter
2017-09-13 11:40 ` [PATCH V8 01/14] mmc: core: Introduce host claiming by context Adrian Hunter
2017-09-20  9:00   ` Ulf Hansson
2017-09-22 11:23   ` Linus Walleij
2017-09-13 11:40 ` [PATCH V8 02/14] mmc: core: Add support for handling CQE requests Adrian Hunter
2017-09-13 11:40 ` [PATCH V8 03/14] mmc: mmc: Enable Command Queuing Adrian Hunter
2017-09-13 11:40 ` [PATCH V8 04/14] mmc: mmc: Enable CQE's Adrian Hunter
2017-09-13 11:40 ` [PATCH V8 05/14] mmc: block: Use local variables in mmc_blk_data_prep() Adrian Hunter
2017-09-13 11:40 ` Adrian Hunter [this message]
2017-09-13 11:40 ` [PATCH V8 07/14] mmc: block: Factor out mmc_setup_queue() Adrian Hunter
2017-09-13 11:40 ` [PATCH V8 08/14] mmc: core: Add parameter use_blk_mq Adrian Hunter
2017-09-21  9:47   ` Ulf Hansson
2017-09-22 13:30     ` Adrian Hunter
2017-09-22 14:01       ` Linus Walleij
2017-09-13 11:40 ` [PATCH V8 09/14] mmc: core: Remove unnecessary host claim Adrian Hunter
2017-09-13 11:40 ` [PATCH V8 10/14] mmc: core: Export mmc_start_bkops() Adrian Hunter
2017-09-13 11:40 ` [PATCH V8 11/14] mmc: core: Export mmc_start_request() Adrian Hunter
2017-09-13 11:40 ` [PATCH V8 12/14] mmc: block: Add CQE and blk-mq support Adrian Hunter
2017-09-21  9:59   ` Ulf Hansson
2017-09-21 11:17     ` Adrian Hunter
2017-09-13 11:40 ` [PATCH V8 13/14] mmc: cqhci: support for command queue enabled host Adrian Hunter
2017-09-13 11:40 ` [PATCH V8 14/14] mmc: sdhci-pci: Add CQHCI support for Intel GLK Adrian Hunter
2017-09-18 12:19   ` [PATCH V9 " Adrian Hunter
2017-09-21  9:01 ` [PATCH V8 00/14] mmc: Add Command Queue support Ulf Hansson
2017-09-21  9:44   ` Adrian Hunter
2017-10-10 12:12     ` Ulf Hansson
2017-10-10 12:24       ` Adrian Hunter
2017-10-10 13:08         ` Ulf Hansson
2017-10-10 13:31           ` Adrian Hunter
2017-10-11 12:13             ` Ulf Hansson
2017-10-11 12:58               ` Adrian Hunter
2017-10-11 13:58                 ` Ulf Hansson
2017-10-12  8:08                   ` Linus Walleij
2017-10-12  8:28                     ` Ulf Hansson
2017-10-13 11:58                   ` Adrian Hunter
2017-10-18  6:16                   ` Adrian Hunter
2017-10-19 11:44                     ` Adrian Hunter
2017-10-20 12:30                       ` Adrian Hunter
2017-10-23 13:06                         ` Adrian Hunter
2017-10-24  5:37                           ` Ulf Hansson
2017-10-24  6:42                             ` Adrian Hunter
2017-10-24  7:39                               ` Ulf Hansson
2017-10-24  9:11                                 ` Adrian Hunter
2017-09-21 14:07 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1505302814-19313-7-git-send-email-adrian.hunter@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=Yuliy.Izrailov@sandisk.com \
    --cc=alex.lemberg@sandisk.com \
    --cc=asutoshd@codeaurora.org \
    --cc=dongas86@gmail.com \
    --cc=haibo.chen@nxp.com \
    --cc=hch@lst.de \
    --cc=jh80.chung@samsung.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=mateusz.nowak@intel.com \
    --cc=riteshh@codeaurora.org \
    --cc=shawn.lin@rock-chips.com \
    --cc=stummala@codeaurora.org \
    --cc=ulf.hansson@linaro.org \
    --cc=vbyravarasu@nvidia.com \
    --cc=zhangfei.gao@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.