All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang7@gmail.com>
To: adrian.hunter@intel.com, ulf.hansson@linaro.org
Cc: orsonzhai@gmail.com, zhang.lyra@gmail.com,
	baolin.wang7@gmail.com, arnd@arndb.de, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/3] mmc: host: Introduce the request_atomic() for the host
Date: Tue, 17 Mar 2020 18:14:09 +0800	[thread overview]
Message-ID: <f4ffe80d664a970bb33ab94791bf67f9545e3e29.1584428736.git.baolin.wang7@gmail.com> (raw)
In-Reply-To: <cover.1584428736.git.baolin.wang7@gmail.com>
In-Reply-To: <cover.1584428736.git.baolin.wang7@gmail.com>

The SD host controller can process one request in the atomic context if
the card is nonremovable, which means we can submit next request in the
irq hard handler when using the MMC host software queue to reduce the
latency. Thus this patch adds a new API request_atomic() for the host
controller, as well as adding support for host software queue to submit
a request by the new request_atomic() API.

Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Baolin Wang <baolin.wang7@gmail.com>
---
 drivers/mmc/host/mmc_hsq.c | 5 ++++-
 include/linux/mmc/host.h   | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/mmc_hsq.c b/drivers/mmc/host/mmc_hsq.c
index 59d2776..fdbaa98 100644
--- a/drivers/mmc/host/mmc_hsq.c
+++ b/drivers/mmc/host/mmc_hsq.c
@@ -41,7 +41,10 @@ static void mmc_hsq_pump_requests(struct mmc_hsq *hsq)
 
 	spin_unlock_irqrestore(&hsq->lock, flags);
 
-	mmc->ops->request(mmc, hsq->mrq);
+	if (mmc->ops->request_atomic)
+		mmc->ops->request_atomic(mmc, hsq->mrq);
+	else
+		mmc->ops->request(mmc, hsq->mrq);
 }
 
 static void mmc_hsq_update_next_tag(struct mmc_hsq *hsq, int remains)
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 562ed06..db5e59c 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -92,6 +92,9 @@ struct mmc_host_ops {
 			    int err);
 	void	(*pre_req)(struct mmc_host *host, struct mmc_request *req);
 	void	(*request)(struct mmc_host *host, struct mmc_request *req);
+	/* Submit one request to host in atomic context. */
+	void	(*request_atomic)(struct mmc_host *host,
+				  struct mmc_request *req);
 
 	/*
 	 * Avoid calling the next three functions too often or in a "fast
-- 
1.9.1


  reply	other threads:[~2020-03-17 10:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-17 10:14 [PATCH v2 0/3] Introduce the request_atomic() for the host Baolin Wang
2020-03-17 10:14 ` Baolin Wang [this message]
2020-03-17 10:14 ` [PATCH v2 2/3] mmc: host: sdhci: Implement the request_atomic() API Baolin Wang
2020-03-17 10:14 ` [PATCH v2 3/3] mmc: host: sdhci-sprd: " Baolin Wang
2020-03-17 13:25 ` [PATCH v2 0/3] Introduce the request_atomic() for the host Adrian Hunter
2020-03-17 13:49   ` Baolin Wang
2020-03-17 15:06     ` Adrian Hunter
2020-03-18  7:35       ` Baolin Wang

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=f4ffe80d664a970bb33ab94791bf67f9545e3e29.1584428736.git.baolin.wang7@gmail.com \
    --to=baolin.wang7@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=ulf.hansson@linaro.org \
    --cc=zhang.lyra@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.